@@ -20,6 +20,13 @@ jest.mock('uiSrc/services', () => ({
2020 ...jest . requireActual ( 'uiSrc/services' ) ,
2121} ) )
2222
23+ let store : typeof mockedStore
24+ beforeEach ( ( ) => {
25+ cleanup ( )
26+ store = cloneDeep ( mockedStore )
27+ store . clearActions ( )
28+ } )
29+
2330describe ( 'clientCerts slice' , ( ) => {
2431 describe ( 'reducer, actions and selectors' , ( ) => {
2532 it ( 'should return the initial state on first run' , ( ) => {
@@ -201,7 +208,6 @@ describe('clientCerts slice', () => {
201208 const responsePayload = { data, status : 200 }
202209
203210 apiService . get = jest . fn ( ) . mockResolvedValue ( responsePayload )
204- const store = cloneDeep ( mockedStore )
205211
206212 // Act
207213 await store . dispatch < any > ( fetchClientCerts ( ) )
@@ -231,8 +237,6 @@ describe('clientCerts slice', () => {
231237
232238 const id = '70b95d32-c19d-4311-bb24-e684af12cf15'
233239
234- const store = cloneDeep ( mockedStore )
235-
236240 // Act
237241 await store . dispatch < any > ( deleteClientCertAction ( id , onSuccessAction ) )
238242
@@ -259,8 +263,6 @@ describe('clientCerts slice', () => {
259263 const onSuccessAction = jest . fn ( )
260264 const id = '70b95d32-c19d-4311-bb24-e684af12cf15'
261265
262- const store = cloneDeep ( mockedStore )
263-
264266 // Act
265267 await store . dispatch < any > ( deleteClientCertAction ( id , onSuccessAction ) )
266268
0 commit comments