@@ -10,6 +10,10 @@ import reducer, {
10
10
loadClientCertsFailure ,
11
11
clientCertsSelector ,
12
12
fetchClientCerts ,
13
+ deleteClientCert ,
14
+ deleteClientCertSuccess ,
15
+ deleteClientCertFailure ,
16
+ deleteClientCertAction ,
13
17
} from '../../instances/clientCerts'
14
18
15
19
jest . mock ( 'uiSrc/services' , ( ) => ( {
@@ -48,7 +52,7 @@ describe('clientCerts slice', () => {
48
52
} )
49
53
expect ( clientCertsSelector ( rootState ) ) . toEqual ( state )
50
54
} )
51
- }
55
+ } )
52
56
53
57
describe ( 'loadClientCerts' , ( ) => {
54
58
it ( 'should properly set the state before the fetch data' , ( ) => {
@@ -90,7 +94,7 @@ describe('clientCerts slice', () => {
90
94
} )
91
95
expect ( clientCertsSelector ( rootState ) ) . toEqual ( state )
92
96
} )
93
- }
97
+ } )
94
98
95
99
describe ( 'loadClientCertsSuccess' , ( ) => {
96
100
it ( 'should properly set the state with fetched data' , ( ) => {
@@ -230,14 +234,13 @@ describe('clientCerts slice', () => {
230
234
const store = cloneDeep ( mockedStore )
231
235
232
236
// Act
233
- await store . dispatch < any > ( deleteClientCert ( id , onSuccessAction ) )
237
+ await store . dispatch < any > ( deleteClientCertAction ( id , onSuccessAction ) )
234
238
235
239
// Assert onSuccessAction
236
240
expect ( onSuccessAction ) . toBeCalled ( )
237
241
238
242
// Assert
239
243
const expectedActions = [
240
- deleteClientCert ( ) ,
241
244
deleteClientCertSuccess ( ) ,
242
245
loadClientCerts ( ) ,
243
246
loadClientCertsSuccess ( fetchResponsePayload . data ) ,
@@ -259,14 +262,13 @@ describe('clientCerts slice', () => {
259
262
const store = cloneDeep ( mockedStore )
260
263
261
264
// Act
262
- await store . dispatch < any > ( deleteClientCert ( id , onSuccessAction ) )
265
+ await store . dispatch < any > ( deleteClientCertAction ( id , onSuccessAction ) )
263
266
264
267
// assert that onSuccessAction is not called
265
268
expect ( onSuccessAction ) . not . toBeCalled ( )
266
269
267
270
// Assert
268
271
const expectedActions = [
269
- deleteClientCert ( ) ,
270
272
addErrorNotification ( responsePayload as AxiosError ) ,
271
273
deleteClientCertFailure ( responsePayload . response . data . message ) ,
272
274
]
0 commit comments