From 1f89dbc4819ea08688cf75695d29519b4de360b5 Mon Sep 17 00:00:00 2001 From: Sorrel Bri Date: Wed, 29 Jan 2020 13:28:49 -0800 Subject: [PATCH] patch to cleanup reducer directory filenames --- packages/play-node-go/play-node-go/src/App.js | 4 ++-- .../src/components/Form/Login/Login.test.js | 2 +- .../src/components/Form/Signup/Signup.test.js | 2 +- .../play-node-go/src/pages/Game/Game.test.js | 4 +++- .../src/pages/Layout/NavBar/NavBar.test.js | 2 +- .../play-node-go/src/pages/Room/Room.js | 2 +- .../play-node-go/src/pages/Room/Room.test.js | 4 ++-- .../{stateReducer.auth.js => reducer.auth.js} | 2 +- ...Reducer.auth.test.js => reducer.auth.test.js} | 2 +- .../err/{stateReducer.err.js => reducer.err.js} | 2 +- .../{stateReducer.games.js => reducer.games.js} | 4 ++-- ...ducer.games.test.js => reducer.games.test.js} | 4 ++-- .../{stateReducer.index.js => reducer.index.js} | 2 +- .../{stateReducer.init.js => reducer.init.js} | 2 +- ...teReducer.messages.js => reducer.messages.js} | 4 ++-- ...messages.test.js => reducer.messages.test.js} | 4 ++-- .../src/reducers/{stateReducer.js => reducer.js} | 16 ++++++++-------- .../{stateReducer.test.js => reducer.test.js} | 2 +- .../{stateReducer.rooms.js => reducer.rooms.js} | 4 ++-- ...ducer.rooms.test.js => reducer.rooms.test.js} | 4 ++-- ...{stateReducer.socket.js => reducer.socket.js} | 4 ++-- 21 files changed, 39 insertions(+), 37 deletions(-) rename packages/play-node-go/play-node-go/src/reducers/auth/{stateReducer.auth.js => reducer.auth.js} (89%) rename packages/play-node-go/play-node-go/src/reducers/auth/{stateReducer.auth.test.js => reducer.auth.test.js} (86%) rename packages/play-node-go/play-node-go/src/reducers/err/{stateReducer.err.js => reducer.err.js} (93%) rename packages/play-node-go/play-node-go/src/reducers/games/{stateReducer.games.js => reducer.games.js} (92%) rename packages/play-node-go/play-node-go/src/reducers/games/{stateReducer.games.test.js => reducer.games.test.js} (93%) rename packages/play-node-go/play-node-go/src/reducers/index/{stateReducer.index.js => reducer.index.js} (81%) rename packages/play-node-go/play-node-go/src/reducers/init/{stateReducer.init.js => reducer.init.js} (93%) rename packages/play-node-go/play-node-go/src/reducers/messages/{stateReducer.messages.js => reducer.messages.js} (71%) rename packages/play-node-go/play-node-go/src/reducers/messages/{stateReducer.messages.test.js => reducer.messages.test.js} (85%) rename packages/play-node-go/play-node-go/src/reducers/{stateReducer.js => reducer.js} (68%) rename packages/play-node-go/play-node-go/src/reducers/{stateReducer.test.js => reducer.test.js} (80%) rename packages/play-node-go/play-node-go/src/reducers/rooms/{stateReducer.rooms.js => reducer.rooms.js} (94%) rename packages/play-node-go/play-node-go/src/reducers/rooms/{stateReducer.rooms.test.js => reducer.rooms.test.js} (93%) rename packages/play-node-go/play-node-go/src/reducers/socket/{stateReducer.socket.js => reducer.socket.js} (90%) diff --git a/packages/play-node-go/play-node-go/src/App.js b/packages/play-node-go/play-node-go/src/App.js index 36f4ac7..0f0efcb 100644 --- a/packages/play-node-go/play-node-go/src/App.js +++ b/packages/play-node-go/play-node-go/src/App.js @@ -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'; diff --git a/packages/play-node-go/play-node-go/src/components/Form/Login/Login.test.js b/packages/play-node-go/play-node-go/src/components/Form/Login/Login.test.js index eeaecc4..2a53a5d 100644 --- a/packages/play-node-go/play-node-go/src/components/Form/Login/Login.test.js +++ b/packages/play-node-go/play-node-go/src/components/Form/Login/Login.test.js @@ -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(); diff --git a/packages/play-node-go/play-node-go/src/components/Form/Signup/Signup.test.js b/packages/play-node-go/play-node-go/src/components/Form/Signup/Signup.test.js index b7e7fb1..16218c0 100644 --- a/packages/play-node-go/play-node-go/src/components/Form/Signup/Signup.test.js +++ b/packages/play-node-go/play-node-go/src/components/Form/Signup/Signup.test.js @@ -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(); diff --git a/packages/play-node-go/play-node-go/src/pages/Game/Game.test.js b/packages/play-node-go/play-node-go/src/pages/Game/Game.test.js index 8e6644f..ca0b821 100644 --- a/packages/play-node-go/play-node-go/src/pages/Game/Game.test.js +++ b/packages/play-node-go/play-node-go/src/pages/Game/Game.test.js @@ -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( - + ); const GameDiv = getByTestId('Game'); diff --git a/packages/play-node-go/play-node-go/src/pages/Layout/NavBar/NavBar.test.js b/packages/play-node-go/play-node-go/src/pages/Layout/NavBar/NavBar.test.js index 874f914..9318052 100644 --- a/packages/play-node-go/play-node-go/src/pages/Layout/NavBar/NavBar.test.js +++ b/packages/play-node-go/play-node-go/src/pages/Layout/NavBar/NavBar.test.js @@ -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( diff --git a/packages/play-node-go/play-node-go/src/pages/Room/Room.js b/packages/play-node-go/play-node-go/src/pages/Room/Room.js index 2695d60..68a459f 100644 --- a/packages/play-node-go/play-node-go/src/pages/Room/Room.js +++ b/packages/play-node-go/play-node-go/src/pages/Room/Room.js @@ -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}`); diff --git a/packages/play-node-go/play-node-go/src/pages/Room/Room.test.js b/packages/play-node-go/play-node-go/src/pages/Room/Room.test.js index 9df0950..a3724d0 100644 --- a/packages/play-node-go/play-node-go/src/pages/Room/Room.test.js +++ b/packages/play-node-go/play-node-go/src/pages/Room/Room.test.js @@ -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( - + {}}/> ); const RoomDiv = getByTestId('Room'); diff --git a/packages/play-node-go/play-node-go/src/reducers/auth/stateReducer.auth.js b/packages/play-node-go/play-node-go/src/reducers/auth/reducer.auth.js similarity index 89% rename from packages/play-node-go/play-node-go/src/reducers/auth/stateReducer.auth.js rename to packages/play-node-go/play-node-go/src/reducers/auth/reducer.auth.js index 015c686..20585eb 100644 --- a/packages/play-node-go/play-node-go/src/reducers/auth/stateReducer.auth.js +++ b/packages/play-node-go/play-node-go/src/reducers/auth/reducer.auth.js @@ -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) { diff --git a/packages/play-node-go/play-node-go/src/reducers/auth/stateReducer.auth.test.js b/packages/play-node-go/play-node-go/src/reducers/auth/reducer.auth.test.js similarity index 86% rename from packages/play-node-go/play-node-go/src/reducers/auth/stateReducer.auth.test.js rename to packages/play-node-go/play-node-go/src/reducers/auth/reducer.auth.test.js index e443c1e..5094380 100644 --- a/packages/play-node-go/play-node-go/src/reducers/auth/stateReducer.auth.test.js +++ b/packages/play-node-go/play-node-go/src/reducers/auth/reducer.auth.test.js @@ -1,4 +1,4 @@ -import {authReducer} from './stateReducer.auth'; +import {authReducer} from './reducer.auth'; const newCredentials = { username: 'newUsername7', diff --git a/packages/play-node-go/play-node-go/src/reducers/err/stateReducer.err.js b/packages/play-node-go/play-node-go/src/reducers/err/reducer.err.js similarity index 93% rename from packages/play-node-go/play-node-go/src/reducers/err/stateReducer.err.js rename to packages/play-node-go/play-node-go/src/reducers/err/reducer.err.js index d563dd4..ead71e1 100644 --- a/packages/play-node-go/play-node-go/src/reducers/err/stateReducer.err.js +++ b/packages/play-node-go/play-node-go/src/reducers/err/reducer.err.js @@ -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) { diff --git a/packages/play-node-go/play-node-go/src/reducers/games/stateReducer.games.js b/packages/play-node-go/play-node-go/src/reducers/games/reducer.games.js similarity index 92% rename from packages/play-node-go/play-node-go/src/reducers/games/stateReducer.games.js rename to packages/play-node-go/play-node-go/src/reducers/games/reducer.games.js index da7a4c4..0a281f2 100644 --- a/packages/play-node-go/play-node-go/src/reducers/games/stateReducer.games.js +++ b/packages/play-node-go/play-node-go/src/reducers/games/reducer.games.js @@ -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) { diff --git a/packages/play-node-go/play-node-go/src/reducers/games/stateReducer.games.test.js b/packages/play-node-go/play-node-go/src/reducers/games/reducer.games.test.js similarity index 93% rename from packages/play-node-go/play-node-go/src/reducers/games/stateReducer.games.test.js rename to packages/play-node-go/play-node-go/src/reducers/games/reducer.games.test.js index 4b27743..65b634e 100644 --- a/packages/play-node-go/play-node-go/src/reducers/games/stateReducer.games.test.js +++ b/packages/play-node-go/play-node-go/src/reducers/games/reducer.games.test.js @@ -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 = [ { diff --git a/packages/play-node-go/play-node-go/src/reducers/index/stateReducer.index.js b/packages/play-node-go/play-node-go/src/reducers/index/reducer.index.js similarity index 81% rename from packages/play-node-go/play-node-go/src/reducers/index/stateReducer.index.js rename to packages/play-node-go/play-node-go/src/reducers/index/reducer.index.js index 299294d..2bd32b7 100644 --- a/packages/play-node-go/play-node-go/src/reducers/index/stateReducer.index.js +++ b/packages/play-node-go/play-node-go/src/reducers/index/reducer.index.js @@ -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) { diff --git a/packages/play-node-go/play-node-go/src/reducers/init/stateReducer.init.js b/packages/play-node-go/play-node-go/src/reducers/init/reducer.init.js similarity index 93% rename from packages/play-node-go/play-node-go/src/reducers/init/stateReducer.init.js rename to packages/play-node-go/play-node-go/src/reducers/init/reducer.init.js index 5a396fa..6346cdc 100644 --- a/packages/play-node-go/play-node-go/src/reducers/init/stateReducer.init.js +++ b/packages/play-node-go/play-node-go/src/reducers/init/reducer.init.js @@ -1,6 +1,6 @@ //@ flow -import type { state } from '../stateReducer'; +import type { state } from '../reducer'; const socket = require('../../io'); export const initState = (): state => { diff --git a/packages/play-node-go/play-node-go/src/reducers/messages/stateReducer.messages.js b/packages/play-node-go/play-node-go/src/reducers/messages/reducer.messages.js similarity index 71% rename from packages/play-node-go/play-node-go/src/reducers/messages/stateReducer.messages.js rename to packages/play-node-go/play-node-go/src/reducers/messages/reducer.messages.js index d795b29..82552a6 100644 --- a/packages/play-node-go/play-node-go/src/reducers/messages/stateReducer.messages.js +++ b/packages/play-node-go/play-node-go/src/reducers/messages/reducer.messages.js @@ -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) { diff --git a/packages/play-node-go/play-node-go/src/reducers/messages/stateReducer.messages.test.js b/packages/play-node-go/play-node-go/src/reducers/messages/reducer.messages.test.js similarity index 85% rename from packages/play-node-go/play-node-go/src/reducers/messages/stateReducer.messages.test.js rename to packages/play-node-go/play-node-go/src/reducers/messages/reducer.messages.test.js index 2601efc..ee085cc 100644 --- a/packages/play-node-go/play-node-go/src/reducers/messages/stateReducer.messages.test.js +++ b/packages/play-node-go/play-node-go/src/reducers/messages/reducer.messages.test.js @@ -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 = [ { diff --git a/packages/play-node-go/play-node-go/src/reducers/stateReducer.js b/packages/play-node-go/play-node-go/src/reducers/reducer.js similarity index 68% rename from packages/play-node-go/play-node-go/src/reducers/stateReducer.js rename to packages/play-node-go/play-node-go/src/reducers/reducer.js index 44c3425..e0d967b 100644 --- a/packages/play-node-go/play-node-go/src/reducers/stateReducer.js +++ b/packages/play-node-go/play-node-go/src/reducers/reducer.js @@ -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: {}, diff --git a/packages/play-node-go/play-node-go/src/reducers/stateReducer.test.js b/packages/play-node-go/play-node-go/src/reducers/reducer.test.js similarity index 80% rename from packages/play-node-go/play-node-go/src/reducers/stateReducer.test.js rename to packages/play-node-go/play-node-go/src/reducers/reducer.test.js index e36d748..f8ae574 100644 --- a/packages/play-node-go/play-node-go/src/reducers/stateReducer.test.js +++ b/packages/play-node-go/play-node-go/src/reducers/reducer.test.js @@ -1,4 +1,4 @@ -import {stateReducer} from './stateReducer'; +import {stateReducer} from './reducer'; it('default returns state unaltered', () => { const state = {data: 'example'}; diff --git a/packages/play-node-go/play-node-go/src/reducers/rooms/stateReducer.rooms.js b/packages/play-node-go/play-node-go/src/reducers/rooms/reducer.rooms.js similarity index 94% rename from packages/play-node-go/play-node-go/src/reducers/rooms/stateReducer.rooms.js rename to packages/play-node-go/play-node-go/src/reducers/rooms/reducer.rooms.js index 577c868..ebd1cd1 100644 --- a/packages/play-node-go/play-node-go/src/reducers/rooms/stateReducer.rooms.js +++ b/packages/play-node-go/play-node-go/src/reducers/rooms/reducer.rooms.js @@ -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) { diff --git a/packages/play-node-go/play-node-go/src/reducers/rooms/stateReducer.rooms.test.js b/packages/play-node-go/play-node-go/src/reducers/rooms/reducer.rooms.test.js similarity index 93% rename from packages/play-node-go/play-node-go/src/reducers/rooms/stateReducer.rooms.test.js rename to packages/play-node-go/play-node-go/src/reducers/rooms/reducer.rooms.test.js index bb78a0e..be1a304 100644 --- a/packages/play-node-go/play-node-go/src/reducers/rooms/stateReducer.rooms.test.js +++ b/packages/play-node-go/play-node-go/src/reducers/rooms/reducer.rooms.test.js @@ -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 = [ { diff --git a/packages/play-node-go/play-node-go/src/reducers/socket/stateReducer.socket.js b/packages/play-node-go/play-node-go/src/reducers/socket/reducer.socket.js similarity index 90% rename from packages/play-node-go/play-node-go/src/reducers/socket/stateReducer.socket.js rename to packages/play-node-go/play-node-go/src/reducers/socket/reducer.socket.js index e1ef48a..b3c3b6d 100644 --- a/packages/play-node-go/play-node-go/src/reducers/socket/stateReducer.socket.js +++ b/packages/play-node-go/play-node-go/src/reducers/socket/reducer.socket.js @@ -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 => {