1
- import subject from '../app/src/redux/reducers/slice/contextReducer' ;
1
+ import subject from '../app/src/redux/reducers/slice/contextReducer.ts ' ;
2
2
3
3
describe ( 'contextReducer test' , ( ) => {
4
4
let state ;
5
5
6
6
beforeEach ( ( ) => {
7
7
state = {
8
- allContext : [ ]
8
+ allContext : [ ] ,
9
9
} ;
10
10
} ) ;
11
11
@@ -25,16 +25,16 @@ describe('contextReducer test', () => {
25
25
const action = {
26
26
type : 'context/addContext' ,
27
27
payload : {
28
- name : 'Theme Context'
29
- }
28
+ name : 'Theme Context' ,
29
+ } ,
30
30
} ;
31
31
32
32
it ( 'adds a context' , ( ) => {
33
33
const { allContext } = subject ( state , action ) ;
34
34
expect ( allContext [ 0 ] ) . toEqual ( {
35
35
name : 'Theme Context' ,
36
36
values : [ ] ,
37
- components : [ ]
37
+ components : [ ] ,
38
38
} ) ;
39
39
} ) ;
40
40
@@ -49,7 +49,7 @@ describe('contextReducer test', () => {
49
49
} ) ;
50
50
} ) ;
51
51
52
- //OLD ADD CONTEX TEST
52
+ // OLD ADD CONTEX TEST
53
53
54
54
// describe('ADD_CONTEXT', () => {
55
55
// const action = {
@@ -86,9 +86,9 @@ describe('contextReducer test', () => {
86
86
{
87
87
name : 'Theme Context' ,
88
88
values : [ ] ,
89
- components : [ ]
90
- }
91
- ]
89
+ components : [ ] ,
90
+ } ,
91
+ ] ,
92
92
} ;
93
93
} ) ;
94
94
@@ -97,8 +97,8 @@ describe('contextReducer test', () => {
97
97
payload : {
98
98
name : 'Theme Context' ,
99
99
inputKey : 'Theme Color' ,
100
- inputValue : 'Dark'
101
- }
100
+ inputValue : 'Dark' ,
101
+ } ,
102
102
} ;
103
103
104
104
it ( 'adds a key-value pair to values array of the specified context' , ( ) => {
@@ -123,21 +123,21 @@ describe('contextReducer test', () => {
123
123
{
124
124
name : 'Theme Context' ,
125
125
values : [ ] ,
126
- components : [ ]
126
+ components : [ ] ,
127
127
} ,
128
128
{
129
129
name : 'To be deleted' ,
130
130
values : [ ] ,
131
- components : [ ]
132
- }
133
- ]
131
+ components : [ ] ,
132
+ } ,
133
+ ] ,
134
134
} ;
135
135
136
136
action = {
137
137
type : 'context/deleteContext' ,
138
138
payload : {
139
- name : 'Theme Context'
140
- }
139
+ name : 'Theme Context' ,
140
+ } ,
141
141
} ;
142
142
} ) ;
143
143
@@ -161,22 +161,22 @@ describe('contextReducer test', () => {
161
161
{
162
162
name : 'Theme Context' ,
163
163
values : [ ] ,
164
- components : [ ]
165
- }
166
- ]
164
+ components : [ ] ,
165
+ } ,
166
+ ] ,
167
167
} ;
168
168
} ) ;
169
169
170
170
const action = {
171
171
type : 'context/addComponentToContext' ,
172
172
payload : {
173
173
context : {
174
- name : 'Theme Context'
174
+ name : 'Theme Context' ,
175
175
} ,
176
176
component : {
177
- name : 'Main Component'
178
- }
179
- }
177
+ name : 'Main Component' ,
178
+ } ,
179
+ } ,
180
180
} ;
181
181
182
182
it ( 'adds a new component to the specified context' , ( ) => {
0 commit comments