Skip to content

Commit

Permalink
fix rntl test
Browse files Browse the repository at this point in the history
  • Loading branch information
Kacper-RF committed Oct 5, 2023
1 parent 9b9e7c9 commit ce6607f
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { navigationActions } from '../store/navigation/navigation.slice'
import { PossibleImpersonationAttackScreen } from '../screens/PossibleImpersonationAttack/PossibleImpersonationAttack.screen'
import { ScreenNames } from '../const/ScreenNames.enum'
import { navigationSelectors } from '../store/navigation/navigation.selectors'
import { initActions } from '../store/init/init.slice'

describe('Possible Impersonation Attack', () => {
let socket: MockedSocket
Expand All @@ -24,7 +25,7 @@ describe('Possible Impersonation Attack', () => {

it('Open modal when certifcates are duplicated', async () => {
const { store, root } = await prepareStore({}, socket)

store.dispatch(initActions.setStoreReady())
factory = await getFactory(store)

const community = await factory.create<ReturnType<typeof communities.actions.addNewCommunity>['payload']>(
Expand Down Expand Up @@ -68,14 +69,14 @@ describe('Possible Impersonation Attack', () => {
await act(async () => {})

store.dispatch(navigationActions.redirection())

await act(async () => {})

const duplicateCerts = users.selectors.duplicateCerts(store.getState())
const currentScreen = navigationSelectors.currentScreen(store.getState())

expect(currentScreen).toBe(ScreenNames.PossibleImpersonationAttackScreen)
expect(duplicateCerts).toBeTruthy()

root?.cancel()
})
})

0 comments on commit ce6607f

Please sign in to comment.