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