Skip to content

Commit 2b4a6e8

Browse files
committed
move test folders
1 parent fd29df1 commit 2b4a6e8

File tree

2 files changed

+24
-24
lines changed

2 files changed

+24
-24
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@
3939
"react": "^16.8.6",
4040
"react-dom": "^16.8.6"
4141
}
42-
}
42+
}

src/App.spec.js

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,38 +10,38 @@ import App, { dataReducer, Counter } from './App';
1010

1111
const list = ['a', 'b', 'c'];
1212

13-
describe('Reducer Test', () => {
14-
it('should set a list', () => {
15-
const state = { list: [], error: null };
16-
const newState = dataReducer(state, {
17-
type: 'SET_LIST',
18-
list,
13+
describe('App', () => {
14+
describe('Reducer', () => {
15+
it('should set a list', () => {
16+
const state = { list: [], error: null };
17+
const newState = dataReducer(state, {
18+
type: 'SET_LIST',
19+
list,
20+
});
21+
22+
expect(newState).toEqual({ list, error: null });
1923
});
2024

21-
expect(newState).toEqual({ list, error: null });
22-
});
25+
it('should reset the error if list is set', () => {
26+
const state = { list: [], error: true };
27+
const newState = dataReducer(state, {
28+
type: 'SET_LIST',
29+
list,
30+
});
2331

24-
it('should reset the error if list is set', () => {
25-
const state = { list: [], error: true };
26-
const newState = dataReducer(state, {
27-
type: 'SET_LIST',
28-
list,
32+
expect(newState).toEqual({ list, error: null });
2933
});
3034

31-
expect(newState).toEqual({ list, error: null });
32-
});
35+
it('should set the error', () => {
36+
const state = { list: [], error: null };
37+
const newState = dataReducer(state, {
38+
type: 'SET_ERROR',
39+
});
3340

34-
it('should set the error', () => {
35-
const state = { list: [], error: null };
36-
const newState = dataReducer(state, {
37-
type: 'SET_ERROR',
41+
expect(newState.error).toBeTruthy();
3842
});
39-
40-
expect(newState.error).toBeTruthy();
4143
});
42-
});
4344

44-
describe('App', () => {
4545
test('snapshot renders', () => {
4646
const component = renderer.create(<App />);
4747
let tree = component.toJSON();

0 commit comments

Comments
 (0)