patch to cleanup reducer directory filenames

This commit is contained in:
Sorrel Bri 2020-01-29 13:28:49 -08:00 committed by sorrelbri
parent 638e57dd29
commit 6a5ae9cc71
21 changed files with 39 additions and 37 deletions

View file

@ -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';

View file

@ -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();

View file

@ -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()}/>);

View file

@ -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');

View file

@ -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(

View file

@ -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}`);

View file

@ -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');

View file

@ -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) {

View file

@ -1,4 +1,4 @@
import {authReducer} from './stateReducer.auth';
import {authReducer} from './reducer.auth';
const newCredentials = {
username: 'newUsername7',

View file

@ -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) {

View file

@ -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) {

View file

@ -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 = [
{

View file

@ -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) {

View file

@ -1,6 +1,6 @@
//@ flow
import type { state } from '../stateReducer';
import type { state } from '../reducer';
const socket = require('../../io');
export const initState = (): state => {

View file

@ -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) {

View file

@ -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 = [
{

View file

@ -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: {},

View file

@ -1,4 +1,4 @@
import {stateReducer} from './stateReducer';
import {stateReducer} from './reducer';
it('default returns state unaltered', () => {
const state = {data: 'example'};

View file

@ -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) {

View file

@ -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 = [
{

View file

@ -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 => {