patch to cleanup reducer directory filenames
This commit is contained in:
parent
0ac8ca002b
commit
8ec5b8f773
21 changed files with 39 additions and 37 deletions
|
@ -2,8 +2,8 @@ import React, {useState, useEffect, useReducer} from 'react';
|
||||||
import config from './config';
|
import config from './config';
|
||||||
import { Switch, Route, BrowserRouter as Router, Redirect } from 'react-router-dom';
|
import { Switch, Route, BrowserRouter as Router, Redirect } from 'react-router-dom';
|
||||||
import MainWrapper from './pages/Layout/MainWrapper/MainWrapper';
|
import MainWrapper from './pages/Layout/MainWrapper/MainWrapper';
|
||||||
import { stateReducer } from './reducers/stateReducer';
|
import { stateReducer } from './reducers/reducer';
|
||||||
import { initState } from './reducers/init/stateReducer.init';
|
import { initState } from './reducers/init/reducer.init';
|
||||||
import indexServices from './services/api/indexServices';
|
import indexServices from './services/api/indexServices';
|
||||||
import './App.scss';
|
import './App.scss';
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { render } from '@testing-library/react';
|
import { render } from '@testing-library/react';
|
||||||
import Login from './Login';
|
import Login from './Login';
|
||||||
import { initState } from '../../../reducers/init/stateReducer.init';
|
import { initState } from '../../../reducers/init/reducer.init';
|
||||||
|
|
||||||
test('renders Login without crashing', () => {
|
test('renders Login without crashing', () => {
|
||||||
const state = initState();
|
const state = initState();
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { render } from '@testing-library/react';
|
import { render } from '@testing-library/react';
|
||||||
import Signup from './Signup';
|
import Signup from './Signup';
|
||||||
import { initState } from '../../../reducers/init/stateReducer.init';
|
import { initState } from '../../../reducers/init/reducer.init';
|
||||||
|
|
||||||
test('renders Signup without crashing', () => {
|
test('renders Signup without crashing', () => {
|
||||||
const { getByTestId } = render(<Signup state={initState()}/>);
|
const { getByTestId } = render(<Signup state={initState()}/>);
|
||||||
|
|
|
@ -1,12 +1,14 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { BrowserRouter as Router } from 'react-router-dom'
|
import { BrowserRouter as Router } from 'react-router-dom'
|
||||||
import { render } from '@testing-library/react';
|
import { render } from '@testing-library/react';
|
||||||
|
import { initState } from '../../reducers/init/reducer.init';
|
||||||
import Game from './Game';
|
import Game from './Game';
|
||||||
|
|
||||||
|
const state = initState();
|
||||||
test('renders Game without crashing', () => {
|
test('renders Game without crashing', () => {
|
||||||
const { getByTestId } = render(
|
const { getByTestId } = render(
|
||||||
<Router>
|
<Router>
|
||||||
<Game />
|
<Game state={state} />
|
||||||
</Router>
|
</Router>
|
||||||
);
|
);
|
||||||
const GameDiv = getByTestId('Game');
|
const GameDiv = getByTestId('Game');
|
||||||
|
|
|
@ -2,7 +2,7 @@ import React from 'react';
|
||||||
import { BrowserRouter as Router } from 'react-router-dom';
|
import { BrowserRouter as Router } from 'react-router-dom';
|
||||||
import { render } from '@testing-library/react';
|
import { render } from '@testing-library/react';
|
||||||
import NavBar from './NavBar';
|
import NavBar from './NavBar';
|
||||||
import { initState } from '../../../reducers/init/stateReducer.init';
|
import { initState } from '../../../reducers/init/reducer.init';
|
||||||
|
|
||||||
test('renders NavBar without crashing', () => {
|
test('renders NavBar without crashing', () => {
|
||||||
const { getByTestId } = render(
|
const { getByTestId } = render(
|
||||||
|
|
|
@ -12,7 +12,7 @@ import Development from '../../components/Display/Development/Development';
|
||||||
import Loading from '../../components/Display/Loading/Loading';
|
import Loading from '../../components/Display/Loading/Loading';
|
||||||
|
|
||||||
const Room = (props) => {
|
const Room = (props) => {
|
||||||
const { state, dispatch} = props;
|
const { state, dispatch } = props;
|
||||||
const roomId = parseInt(useParams().id) || 0;
|
const roomId = parseInt(useParams().id) || 0;
|
||||||
// const socket = socketIOClient(`${config.socketAddress}/${roomId}`);
|
// const socket = socketIOClient(`${config.socketAddress}/${roomId}`);
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { render } from '@testing-library/react';
|
import { render } from '@testing-library/react';
|
||||||
import { BrowserRouter as Router } from 'react-router-dom';
|
import { BrowserRouter as Router } from 'react-router-dom';
|
||||||
import { initState } from '../../reducers/init/stateReducer.init';
|
import { initState } from '../../reducers/init/reducer.init';
|
||||||
import Room from './Room';
|
import Room from './Room';
|
||||||
|
|
||||||
const state = initState();
|
const state = initState();
|
||||||
test('renders Room without crashing', () => {
|
test('renders Room without crashing', () => {
|
||||||
const { getByTestId } = render(
|
const { getByTestId } = render(
|
||||||
<Router>
|
<Router>
|
||||||
<Room state={state} />
|
<Room state={state} dispatch={() => {}}/>
|
||||||
</Router>
|
</Router>
|
||||||
);
|
);
|
||||||
const RoomDiv = getByTestId('Room');
|
const RoomDiv = getByTestId('Room');
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// @flow
|
// @flow
|
||||||
import type { state, action } from '../stateReducer';
|
import type { state, action } from '../reducer';
|
||||||
|
|
||||||
export const authReducer = (state: state, action: action):state => {
|
export const authReducer = (state: state, action: action):state => {
|
||||||
switch (action.message) {
|
switch (action.message) {
|
|
@ -1,4 +1,4 @@
|
||||||
import {authReducer} from './stateReducer.auth';
|
import {authReducer} from './reducer.auth';
|
||||||
|
|
||||||
const newCredentials = {
|
const newCredentials = {
|
||||||
username: 'newUsername7',
|
username: 'newUsername7',
|
|
@ -1,5 +1,5 @@
|
||||||
// @flow
|
// @flow
|
||||||
import type { state, action } from '../stateReducer';
|
import type { state, action } from '../reducer';
|
||||||
|
|
||||||
export const errorReducer = (state: state, action: action):state => {
|
export const errorReducer = (state: state, action: action):state => {
|
||||||
switch (action.message) {
|
switch (action.message) {
|
|
@ -1,6 +1,6 @@
|
||||||
// @flow
|
// @flow
|
||||||
import type { state, action } from '../stateReducer';
|
import type { state, action } from '../reducer';
|
||||||
import { stateReducer } from '../stateReducer';
|
import { stateReducer } from '../reducer';
|
||||||
|
|
||||||
export const gamesReducer = (state: state, action: action):state => {
|
export const gamesReducer = (state: state, action: action):state => {
|
||||||
switch(action.message) {
|
switch(action.message) {
|
|
@ -1,5 +1,5 @@
|
||||||
import {stateReducer} from '../stateReducer';
|
import {stateReducer} from '../reducer';
|
||||||
import { initState } from '../init/stateReducer.init';
|
import { initState } from '../init/reducer.init';
|
||||||
|
|
||||||
const gamesData = [
|
const gamesData = [
|
||||||
{
|
{
|
|
@ -1,5 +1,5 @@
|
||||||
// @flow
|
// @flow
|
||||||
import type { state, action } from '../stateReducer';
|
import type { state, action } from '../reducer';
|
||||||
|
|
||||||
export const indexReducer = (state: state, action: action):state => {
|
export const indexReducer = (state: state, action: action):state => {
|
||||||
switch(action.message) {
|
switch(action.message) {
|
|
@ -1,6 +1,6 @@
|
||||||
//@ flow
|
//@ flow
|
||||||
|
|
||||||
import type { state } from '../stateReducer';
|
import type { state } from '../reducer';
|
||||||
const socket = require('../../io');
|
const socket = require('../../io');
|
||||||
|
|
||||||
export const initState = (): state => {
|
export const initState = (): state => {
|
|
@ -1,6 +1,6 @@
|
||||||
// @flow
|
// @flow
|
||||||
import type { state, action } from '../stateReducer';
|
import type { state, action } from '../reducer';
|
||||||
import { stateReducer } from '../stateReducer';
|
import { stateReducer } from '../reducer';
|
||||||
|
|
||||||
export const messagesReducer = (state: state, action: action):state => {
|
export const messagesReducer = (state: state, action: action):state => {
|
||||||
switch(action.message) {
|
switch(action.message) {
|
|
@ -1,5 +1,5 @@
|
||||||
import {stateReducer} from '../stateReducer';
|
import {stateReducer} from '../reducer';
|
||||||
import { initState } from '../init/stateReducer.init';
|
import { initState } from '../init/reducer.init';
|
||||||
|
|
||||||
const messagesData = [
|
const messagesData = [
|
||||||
{
|
{
|
|
@ -1,12 +1,12 @@
|
||||||
// @flow
|
// @flow
|
||||||
import { initState } from './init/stateReducer.init';
|
import { initState } from './init/reducer.init';
|
||||||
import { authReducer } from './auth/stateReducer.auth';
|
import { authReducer } from './auth/reducer.auth';
|
||||||
import { errorReducer } from './err/stateReducer.err';
|
import { errorReducer } from './err/reducer.err';
|
||||||
import { indexReducer } from './index/stateReducer.index';
|
import { indexReducer } from './index/reducer.index';
|
||||||
import { roomsReducer } from './rooms/stateReducer.rooms';
|
import { roomsReducer } from './rooms/reducer.rooms';
|
||||||
import { messagesReducer } from './messages/stateReducer.messages';
|
import { messagesReducer } from './messages/reducer.messages';
|
||||||
import { gamesReducer } from './games/stateReducer.games';
|
import { gamesReducer } from './games/reducer.games';
|
||||||
import { socketReducer } from './socket/stateReducer.socket';
|
import { socketReducer } from './socket/reducer.socket';
|
||||||
|
|
||||||
export type state = {
|
export type state = {
|
||||||
user: {},
|
user: {},
|
|
@ -1,4 +1,4 @@
|
||||||
import {stateReducer} from './stateReducer';
|
import {stateReducer} from './reducer';
|
||||||
|
|
||||||
it('default returns state unaltered', () => {
|
it('default returns state unaltered', () => {
|
||||||
const state = {data: 'example'};
|
const state = {data: 'example'};
|
|
@ -1,6 +1,6 @@
|
||||||
// @flow
|
// @flow
|
||||||
import type { state, action } from '../stateReducer';
|
import type { state, action } from '../reducer';
|
||||||
import { stateReducer } from '../stateReducer';
|
import { stateReducer } from '../reducer';
|
||||||
|
|
||||||
export const roomsReducer = (state: state, action: action):state => {
|
export const roomsReducer = (state: state, action: action):state => {
|
||||||
switch(action.message) {
|
switch(action.message) {
|
|
@ -1,5 +1,5 @@
|
||||||
import {stateReducer} from '../stateReducer';
|
import {stateReducer} from '../reducer';
|
||||||
import { initState } from '../init/stateReducer.init';
|
import { initState } from '../init/reducer.init';
|
||||||
|
|
||||||
const roomsData = [
|
const roomsData = [
|
||||||
{
|
{
|
|
@ -1,6 +1,6 @@
|
||||||
// @flow
|
// @flow
|
||||||
import type { state, action } from '../stateReducer';
|
import type { state, action } from '../reducer';
|
||||||
import { stateReducer } from '../stateReducer';
|
import { stateReducer } from '../reducer';
|
||||||
const io = require('../../io');
|
const io = require('../../io');
|
||||||
|
|
||||||
export const socketReducer = (state: state, action: action):state => {
|
export const socketReducer = (state: state, action: action):state => {
|
Loading…
Reference in a new issue