Skip to content

Commit 0be9759

Browse files
committed
Add missing bracket and fix import
1 parent 8f8ef39 commit 0be9759

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

redisinsight/ui/src/slices/tests/instances/clientCerts.spec.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ import reducer, {
1010
loadClientCertsFailure,
1111
clientCertsSelector,
1212
fetchClientCerts,
13+
deleteClientCert,
14+
deleteClientCertSuccess,
15+
deleteClientCertFailure,
16+
deleteClientCertAction,
1317
} from '../../instances/clientCerts'
1418

1519
jest.mock('uiSrc/services', () => ({
@@ -48,7 +52,7 @@ describe('clientCerts slice', () => {
4852
})
4953
expect(clientCertsSelector(rootState)).toEqual(state)
5054
})
51-
}
55+
})
5256

5357
describe('loadClientCerts', () => {
5458
it('should properly set the state before the fetch data', () => {
@@ -90,7 +94,7 @@ describe('clientCerts slice', () => {
9094
})
9195
expect(clientCertsSelector(rootState)).toEqual(state)
9296
})
93-
}
97+
})
9498

9599
describe('loadClientCertsSuccess', () => {
96100
it('should properly set the state with fetched data', () => {
@@ -230,14 +234,13 @@ describe('clientCerts slice', () => {
230234
const store = cloneDeep(mockedStore)
231235

232236
// Act
233-
await store.dispatch<any>(deleteClientCert(id, onSuccessAction))
237+
await store.dispatch<any>(deleteClientCertAction(id, onSuccessAction))
234238

235239
// Assert onSuccessAction
236240
expect(onSuccessAction).toBeCalled()
237241

238242
// Assert
239243
const expectedActions = [
240-
deleteClientCert(),
241244
deleteClientCertSuccess(),
242245
loadClientCerts(),
243246
loadClientCertsSuccess(fetchResponsePayload.data),
@@ -259,14 +262,13 @@ describe('clientCerts slice', () => {
259262
const store = cloneDeep(mockedStore)
260263

261264
// Act
262-
await store.dispatch<any>(deleteClientCert(id, onSuccessAction))
265+
await store.dispatch<any>(deleteClientCertAction(id, onSuccessAction))
263266

264267
// assert that onSuccessAction is not called
265268
expect(onSuccessAction).not.toBeCalled()
266269

267270
// Assert
268271
const expectedActions = [
269-
deleteClientCert(),
270272
addErrorNotification(responsePayload as AxiosError),
271273
deleteClientCertFailure(responsePayload.response.data.message),
272274
]

0 commit comments

Comments
 (0)