Skip to content

Commit 53d5d31

Browse files
committed
added test for addProp
1 parent 325ecb2 commit 53d5d31

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

src/actions/__test__/actionCreator.test.tsx renamed to src/actions/__tests__/actionCreator.test.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ describe('Testing All of The Action Creators', () => {
1010
};
1111
expect(actions.addComponent(payld)).toEqual(expectedAction);
1212
});
13+
1314
it('addChild returns a proper action', () => {
1415
const payld = { title: 'Test', childType: 'COMP', HTMLInfo: {} };
1516
const expectedAction = {
@@ -18,4 +19,13 @@ describe('Testing All of The Action Creators', () => {
1819
};
1920
expect(actions.addChild(payld)).toEqual(expectedAction);
2021
});
22+
23+
it('addProp returns a proper action', () => {
24+
const payld = { key: 'Test', type: 'string' };
25+
const expectedAction = {
26+
type: types.ADD_PROP,
27+
payload: payld
28+
};
29+
expect(actions.addProp(payld)).toEqual(expectedAction);
30+
});
2131
});

src/reducers/__tests__/leftReducers.test.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
import * as reducers from '../leftReducers.ts';
2-
import { initialApplicationState } from '../initialState.ts';
1+
import * as reducers from '../leftReducers';
32

4-
initialApplicationState.describe('Left reducers', () => {
5-
let state;
3+
describe('Left reducers', () => {
4+
let state: any;
65

76
// redefine the default state before each reducer test
87
beforeEach(() => {

0 commit comments

Comments
 (0)