@@ -18,7 +18,7 @@ describe('app.js reducers', () => {
18
18
describe ( 'when action doesn\'t match any case' , ( ) => {
19
19
20
20
it ( 'should return original state except the showNPSSurvey state' , ( ) => {
21
- const state = app ( initialState , { type : 'no-op' } ) ;
21
+ const state = app ( initialState , { type : types . NO_OP } ) ;
22
22
expect ( state . gitVersionErrorVisible ) . toEqual ( initialState . gitVersionErrorVisible ) ;
23
23
expect ( state . showNewVersionAvailable ) . toEqual ( initialState . showNewVersionAvailable ) ;
24
24
expect ( state . showBugtrackingNagscreen ) . toEqual ( initialState . showBugtrackingNagscreen ) ;
@@ -31,7 +31,7 @@ describe('app.js reducers', () => {
31
31
} ) ;
32
32
33
33
it ( 'showNPSSurvey state will be true' , ( ) => {
34
- const state = app ( initialState , { type : 'no-op' } ) ;
34
+ const state = app ( initialState , { type : types . NO_OP } ) ;
35
35
expect ( state . showNPSSurvey ) . toEqual ( true ) ;
36
36
} ) ;
37
37
@@ -47,7 +47,7 @@ describe('app.js reducers', () => {
47
47
} ) ;
48
48
49
49
it ( 'showNPSSurvey state will be false' , ( ) => {
50
- const state = app ( initialState , { type : 'no-op' } ) ;
50
+ const state = app ( initialState , { type : types . NO_OP } ) ;
51
51
expect ( state . showNPSSurvey ) . toEqual ( false ) ;
52
52
} ) ;
53
53
@@ -63,7 +63,7 @@ describe('app.js reducers', () => {
63
63
} ) ;
64
64
65
65
it ( 'showNPSSurvey state will be false' , ( ) => {
66
- const state = app ( initialState , { type : 'no-op' } ) ;
66
+ const state = app ( initialState , { type : types . NO_OP } ) ;
67
67
expect ( state . showNPSSurvey ) . toEqual ( false ) ;
68
68
} ) ;
69
69
@@ -73,19 +73,19 @@ describe('app.js reducers', () => {
73
73
} ) ;
74
74
} ) ;
75
75
76
- describe ( 'when RECEIVE_UNGIT_CONFIG action dispatch' , ( ) => {
76
+ describe ( 'when FETCH_UNGIT_CONFIG_SUCCESS action dispatch' , ( ) => {
77
77
describe ( 'if ungitConfig.config.bugtracking is false and bugtrackingNagscreenDismissed is false' , ( ) => {
78
78
it ( 'showBugtrackingNagscreen state will be true' , ( ) => {
79
79
const ungitConfig = { config : { bugtracking : false } } ;
80
- const state = app ( initialState , { type : types . RECEIVE_UNGIT_CONFIG , payload : ungitConfig } , { ungitConfig } ) ;
80
+ const state = app ( initialState , { type : types . FETCH_UNGIT_CONFIG_SUCCESS , payload : ungitConfig } , { ungitConfig } ) ;
81
81
expect ( state . showBugtrackingNagscreen ) . toEqual ( true ) ;
82
82
} ) ;
83
83
} ) ;
84
84
85
85
describe ( 'if ungitConfig.config.bugtracking is true' , ( ) => {
86
86
it ( 'showBugtrackingNagscreen state will be false' , ( ) => {
87
87
const ungitConfig = { config : { bugtracking : true } } ;
88
- const state = app ( initialState , { type : types . RECEIVE_UNGIT_CONFIG , payload : ungitConfig } , { ungitConfig } ) ;
88
+ const state = app ( initialState , { type : types . FETCH_UNGIT_CONFIG_SUCCESS , payload : ungitConfig } , { ungitConfig } ) ;
89
89
expect ( state . showBugtrackingNagscreen ) . toEqual ( false ) ;
90
90
} ) ;
91
91
} ) ;
@@ -94,13 +94,13 @@ describe('app.js reducers', () => {
94
94
it ( 'showBugtrackingNagscreen state will be false' , ( ) => {
95
95
localStorage . setItem ( 'bugtrackingNagscreenDismissed' , true ) ;
96
96
const ungitConfig = { config : { bugtracking : false } } ;
97
- const state = app ( initialState , { type : types . RECEIVE_UNGIT_CONFIG , payload : ungitConfig } , { ungitConfig } ) ;
97
+ const state = app ( initialState , { type : types . FETCH_UNGIT_CONFIG_SUCCESS , payload : ungitConfig } , { ungitConfig } ) ;
98
98
expect ( state . showBugtrackingNagscreen ) . toEqual ( false ) ;
99
99
} ) ;
100
100
} ) ;
101
101
} ) ;
102
102
103
- describe ( 'when RECEIVE_GIT_VERSION action dispatch' , ( ) => {
103
+ describe ( 'when FETCH_GIT_VERSION_SUCCESS action dispatch' , ( ) => {
104
104
describe ( 'if ungitConfig.config.gitVersionCheckOverride is false and gitVersionError is defined && gitVersionErrorDismissed is false' , ( ) => {
105
105
it ( 'gitVersionErrorVisible state will be true' , ( ) => {
106
106
localStorage . setItem ( 'gitVersionErrorDismissed' , false ) ;
@@ -111,7 +111,7 @@ describe('app.js reducers', () => {
111
111
} ;
112
112
const config = { ungitConfig, versions : { gitVersion } } ;
113
113
114
- const state = app ( initialState , { type : types . RECEIVE_GIT_VERSION , payload : gitVersion } , config ) ;
114
+ const state = app ( initialState , { type : types . FETCH_GIT_VERSION_SUCCESS , payload : gitVersion } , config ) ;
115
115
expect ( state . gitVersionErrorVisible ) . toEqual ( true ) ;
116
116
} ) ;
117
117
} ) ;
@@ -126,7 +126,7 @@ describe('app.js reducers', () => {
126
126
} ;
127
127
const config = { ungitConfig, versions : { gitVersion } } ;
128
128
129
- const state = app ( initialState , { type : types . RECEIVE_GIT_VERSION , payload : gitVersion } , config ) ;
129
+ const state = app ( initialState , { type : types . FETCH_GIT_VERSION_SUCCESS , payload : gitVersion } , config ) ;
130
130
expect ( state . gitVersionErrorVisible ) . toEqual ( false ) ;
131
131
} ) ;
132
132
} ) ;
@@ -138,7 +138,7 @@ describe('app.js reducers', () => {
138
138
const gitVersion = { satisfied : true } ;
139
139
const config = { ungitConfig, versions : { gitVersion } } ;
140
140
141
- const state = app ( initialState , { type : types . RECEIVE_GIT_VERSION , payload : gitVersion } , config ) ;
141
+ const state = app ( initialState , { type : types . FETCH_GIT_VERSION_SUCCESS , payload : gitVersion } , config ) ;
142
142
expect ( state . gitVersionErrorVisible ) . toEqual ( false ) ;
143
143
} ) ;
144
144
} ) ;
@@ -153,20 +153,20 @@ describe('app.js reducers', () => {
153
153
} ;
154
154
const config = { ungitConfig, versions : { gitVersion } } ;
155
155
156
- const state = app ( initialState , { type : types . RECEIVE_GIT_VERSION , payload : gitVersion } , config ) ;
156
+ const state = app ( initialState , { type : types . FETCH_GIT_VERSION_SUCCESS , payload : gitVersion } , config ) ;
157
157
expect ( state . gitVersionErrorVisible ) . toEqual ( false ) ;
158
158
} ) ;
159
159
} ) ;
160
160
} ) ;
161
161
162
- describe ( 'when RECEIVE_LATEST_VERSION action dispatch' , ( ) => {
162
+ describe ( 'when FETCH_LATEST_VERSION_SUCCESS action dispatch' , ( ) => {
163
163
describe ( 'gitVersionCheckOverride is false and latestVersion.outdated is true' , ( ) => {
164
164
it ( 'showNewVersionAvailable state will be true' , ( ) => {
165
165
const ungitConfig = { config : { gitVersionCheckOverride : false } } ;
166
166
const latestVersion = { outdated : true } ;
167
167
const config = { ungitConfig, versions : { latestVersion } } ;
168
168
169
- const state = app ( initialState , { type : types . RECEIVE_LATEST_VERSION , payload : latestVersion } , config ) ;
169
+ const state = app ( initialState , { type : types . FETCH_LATEST_VERSION_SUCCESS , payload : latestVersion } , config ) ;
170
170
expect ( state . showNewVersionAvailable ) . toEqual ( true ) ;
171
171
} ) ;
172
172
} ) ;
@@ -177,7 +177,7 @@ describe('app.js reducers', () => {
177
177
const latestVersion = { outdated : true } ;
178
178
const config = { ungitConfig, versions : { latestVersion } } ;
179
179
180
- const state = app ( initialState , { type : types . RECEIVE_LATEST_VERSION , payload : latestVersion } , config ) ;
180
+ const state = app ( initialState , { type : types . FETCH_LATEST_VERSION_SUCCESS , payload : latestVersion } , config ) ;
181
181
expect ( state . showNewVersionAvailable ) . toEqual ( false ) ;
182
182
} ) ;
183
183
} ) ;
@@ -188,20 +188,20 @@ describe('app.js reducers', () => {
188
188
const latestVersion = { outdated : false } ;
189
189
const config = { ungitConfig, versions : { latestVersion } } ;
190
190
191
- const state = app ( initialState , { type : types . RECEIVE_LATEST_VERSION , payload : latestVersion } , config ) ;
191
+ const state = app ( initialState , { type : types . FETCH_LATEST_VERSION_SUCCESS , payload : latestVersion } , config ) ;
192
192
expect ( state . showNewVersionAvailable ) . toEqual ( false ) ;
193
193
} ) ;
194
194
} ) ;
195
195
} ) ;
196
196
197
- describe ( 'when RECEIVE_USER_CONFIG action dispatch' , ( ) => {
197
+ describe ( 'when FETCH_USER_CONFIG_SUCCESS action dispatch' , ( ) => {
198
198
describe ( 'userConfig.bugtracking = false and bugtrackingNagscreenDismissed = false' , ( ) => {
199
199
it ( 'showBugtrackingNagscreen state will be true' , ( ) => {
200
200
const userConfig = { bugtracking : false } ;
201
201
const ungitConfig = { config : { bugtracking : true } } ;
202
202
localStorage . setItem ( 'bugtrackingNagscreenDismissed' , false ) ;
203
203
204
- const state = app ( initialState , { type : types . RECEIVE_USER_CONFIG , payload : userConfig } , { userConfig, ungitConfig } ) ;
204
+ const state = app ( initialState , { type : types . FETCH_USER_CONFIG_SUCCESS , payload : userConfig } , { userConfig, ungitConfig } ) ;
205
205
expect ( state . showBugtrackingNagscreen ) . toEqual ( true ) ;
206
206
} ) ;
207
207
} ) ;
@@ -212,7 +212,7 @@ describe('app.js reducers', () => {
212
212
const ungitConfig = { config : { bugtracking : true } } ;
213
213
localStorage . setItem ( 'bugtrackingNagscreenDismissed' , false ) ;
214
214
215
- const state = app ( initialState , { type : types . RECEIVE_USER_CONFIG , payload : userConfig } , { userConfig, ungitConfig } ) ;
215
+ const state = app ( initialState , { type : types . FETCH_USER_CONFIG_SUCCESS , payload : userConfig } , { userConfig, ungitConfig } ) ;
216
216
expect ( state . showBugtrackingNagscreen ) . toEqual ( false ) ;
217
217
} ) ;
218
218
} ) ;
@@ -223,7 +223,7 @@ describe('app.js reducers', () => {
223
223
const ungitConfig = { config : { bugtracking : true } } ;
224
224
localStorage . setItem ( 'bugtrackingNagscreenDismissed' , true ) ;
225
225
226
- const state = app ( initialState , { type : types . RECEIVE_USER_CONFIG , payload : userConfig } , { userConfig, ungitConfig } ) ;
226
+ const state = app ( initialState , { type : types . FETCH_USER_CONFIG_SUCCESS , payload : userConfig } , { userConfig, ungitConfig } ) ;
227
227
expect ( state . showBugtrackingNagscreen ) . toEqual ( false ) ;
228
228
} ) ;
229
229
} ) ;
0 commit comments