From 5ff9c1c6ec2d2b66c95623cf51e27c729370850b Mon Sep 17 00:00:00 2001 From: Chewbacca Date: Wed, 31 May 2023 08:54:54 -0400 Subject: [PATCH] Fix tests --- app/soapbox/actions/__tests__/account-notes.test.ts | 1 + app/soapbox/actions/__tests__/statuses.test.ts | 1 + .../features/ui/components/__tests__/compose-button.test.tsx | 5 +++-- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/soapbox/actions/__tests__/account-notes.test.ts b/app/soapbox/actions/__tests__/account-notes.test.ts index a00a9d877..dc4eac6f3 100644 --- a/app/soapbox/actions/__tests__/account-notes.test.ts +++ b/app/soapbox/actions/__tests__/account-notes.test.ts @@ -81,6 +81,7 @@ describe('initAccountNoteModal()', () => { }) as Account; const expectedActions = [ { type: 'ACCOUNT_NOTE_INIT_MODAL', account, comment: 'hello' }, + { type: 'MODAL_CLOSE', modalType: 'ACCOUNT_NOTE' }, { type: 'MODAL_OPEN', modalType: 'ACCOUNT_NOTE' }, ]; await store.dispatch(initAccountNoteModal(account)); diff --git a/app/soapbox/actions/__tests__/statuses.test.ts b/app/soapbox/actions/__tests__/statuses.test.ts index 68af7608f..8b057802d 100644 --- a/app/soapbox/actions/__tests__/statuses.test.ts +++ b/app/soapbox/actions/__tests__/statuses.test.ts @@ -123,6 +123,7 @@ describe('deleteStatus()', () => { withRedraft: true, id: 'compose-modal', }, + { type: 'MODAL_CLOSE', modalType: 'COMPOSE', modalProps: undefined }, { type: 'MODAL_OPEN', modalType: 'COMPOSE', modalProps: undefined }, ]; await store.dispatch(deleteStatus(statusId, true)); diff --git a/app/soapbox/features/ui/components/__tests__/compose-button.test.tsx b/app/soapbox/features/ui/components/__tests__/compose-button.test.tsx index 11d9bdea1..a65522a4b 100644 --- a/app/soapbox/features/ui/components/__tests__/compose-button.test.tsx +++ b/app/soapbox/features/ui/components/__tests__/compose-button.test.tsx @@ -5,7 +5,7 @@ import { Provider } from 'react-redux'; import '@testing-library/jest-dom'; import { MemoryRouter } from 'react-router-dom'; -import { MODAL_OPEN } from 'soapbox/actions/modals'; +import { MODAL_CLOSE, MODAL_OPEN } from 'soapbox/actions/modals'; import { mockStore, rootState } from 'soapbox/jest/test-helpers'; import ComposeButton from '../compose-button'; @@ -35,6 +35,7 @@ describe('', () => { expect(store.getActions().length).toEqual(0); fireEvent.click(screen.getByRole('button')); - expect(store.getActions()[0].type).toEqual(MODAL_OPEN); + expect(store.getActions()[0].type).toEqual(MODAL_CLOSE); + expect(store.getActions()[1].type).toEqual(MODAL_OPEN); }); });