From 09a7de00ca4f962c6a57c7d20d3f2aff50460803 Mon Sep 17 00:00:00 2001 From: martincupela Date: Wed, 22 Jan 2025 14:25:18 +0100 Subject: [PATCH] test: make the tests compatible with React v19 --- package.json | 11 +- .../__tests__/AttachmentActions.test.js | 19 +- .../Attachment/__tests__/File.test.js | 6 +- .../AttachmentActions.test.js.snap | 40 +- .../__tests__/__snapshots__/File.test.js.snap | 136 +- .../Avatar/__tests__/Avatar.test.js | 75 +- .../Channel/__tests__/Channel.test.js | 2 +- .../Channel/__tests__/useIsMounted.test.js | 2 +- .../ChannelList/__tests__/ChannelList.test.js | 141 +- .../__tests__/ChannelListMessenger.test.js | 15 +- .../ChannelListMessenger.test.js.snap | 32 +- .../__tests__/ChannelPreviewMessenger.test.js | 5 +- .../ChannelPreviewMessenger.test.js.snap | 154 +- .../useMessageDeliveryStatus.test.js | 2 +- .../__tests__/ChannelSearch.test.js | 8 +- .../ChannelSearch/__tests__/SearchBar.test.js | 28 +- .../__snapshots__/SearchBar.test.js.snap | 88 +- .../CommandItem/__tests__/CommandItem.test.js | 72 +- .../__tests__/DateSeparator.test.js | 100 +- .../__tests__/EmoticonItem.test.js | 62 +- .../__tests__/EmptyStateIndicator.test.js | 14 +- .../__tests__/EventComponent.test.js | 82 +- .../Gallery/__tests__/Gallery.test.js | 58 +- .../Gallery/__tests__/Image.test.js | 16 +- .../__snapshots__/Gallery.test.js.snap | 359 +++-- .../__snapshots__/Image.test.js.snap | 16 +- .../__tests__/InfiniteScroll.test.js | 30 +- .../LoadMore/__tests__/LoadMoreButton.test.js | 37 +- .../__tests__/LoadMorePaginator.test.js | 135 +- .../Loading/__tests__/LoadingChannels.test.js | 8 +- .../__tests__/LoadingErrorIndicator.test.js | 12 +- .../__tests__/LoadingIndicator.test.js | 6 +- .../LoadingChannels.test.js.snap | 68 +- .../LoadingIndicator.test.js.snap | 87 +- src/components/MML/__tests__/MML.test.js | 105 +- .../hooks/__tests__/useMediaRecorder.test.js | 2 +- .../__tests__/FixedHeightMessage.test.js | 11 +- .../Message/__tests__/MessageSimple.test.js | 12 +- .../Message/__tests__/MessageText.test.js | 28 +- .../__snapshots__/MessageText.test.js.snap | 264 ++-- .../hooks/__tests__/useActionHandler.test.js | 2 +- .../hooks/__tests__/useDeleteHandler.test.js | 2 +- .../hooks/__tests__/useEditHandler.test.js | 2 +- .../hooks/__tests__/useFlagHandler.test.js | 2 +- .../__tests__/useMentionsHandler.test.js | 2 +- .../hooks/__tests__/useMuteHandler.test.js | 2 +- .../__tests__/useOpenThreadHandler.test.js | 2 +- .../__tests__/useReactionHandler.test.js | 2 +- .../hooks/__tests__/useReactionsFetcher.js | 2 +- .../hooks/__tests__/useRetryHandler.test.js | 2 +- .../hooks/__tests__/useUserHandler.test.js | 2 +- .../hooks/__tests__/useUserRole.test.js | 2 +- .../__tests__/userMarkUnreadHandler.test.js | 2 +- .../__snapshots__/renderText.test.js.snap | 1258 +++++++++-------- .../renderText/__tests__/renderText.test.js | 292 ++-- .../MessageActions/MessageActions.tsx | 4 +- .../CustomMessageActionsList.test.js | 19 +- .../__tests__/MessageActions.test.js | 123 +- .../__tests__/MessageActionsBox.test.js | 4 +- .../hooks/__tests__/useCooldownTimer.test.js | 2 +- .../__tests__/useMessageInputState.test.js | 23 +- .../__tests__/CustomNotification.test.js | 35 +- .../MessageList/__tests__/MessageList.test.js | 2 +- .../__tests__/VirtualizedMessageList.test.js | 63 +- .../VirtualizedMessageList.test.js.snap | 105 +- .../hooks/__tests__/useGiphyPreview.test.js | 2 +- .../hooks/__tests__/useMarkRead.test.js | 2 +- .../__tests__/usePrependMessagesCount.test.js | 2 +- ...eadMessagesNotificationVirtualized.test.js | 2 +- src/components/Modal/__tests__/Modal.test.js | 6 +- .../__tests__/ReactionSelector.test.js | 4 +- .../Thread/__tests__/Thread.test.js | 29 +- .../Tooltip/__tests__/Tooltip.test.js | 14 +- .../__tests__/TypingIndicator.test.js | 80 +- .../UserItem/__tests__/UserItem.test.js | 64 +- yarn.lock | 463 +++--- 76 files changed, 2392 insertions(+), 2580 deletions(-) diff --git a/package.json b/package.json index 6336267ab..d1d9a8ded 100644 --- a/package.json +++ b/package.json @@ -188,12 +188,12 @@ "@semantic-release/git": "^10.0.1", "@stream-io/rollup-plugin-node-builtins": "^2.1.5", "@stream-io/stream-chat-css": "^5.6.0", - "@testing-library/jest-dom": "^6.1.4", - "@testing-library/react": "^13.1.1", - "@testing-library/react-hooks": "^8.0.0", + "@testing-library/jest-dom": "^6.6.3", + "@testing-library/react": "^16.2.0", "@types/deep-equal": "^1.0.1", "@types/dotenv": "^8.2.0", "@types/hast": "^2.3.4", + "@types/jest": "^29.5.14", "@types/jsdom": "^21.1.5", "@types/linkifyjs": "^2.1.3", "@types/lodash.debounce": "^4.0.7", @@ -248,17 +248,16 @@ "i18next-parser": "^6.0.0", "jest": "^29.7.0", "jest-axe": "^8.0.0", - "jest-environment-jsdom": "^28.1.3", + "jest-environment-jsdom": "^29.7.0", "jsdom": "^24.1.1", "lint-staged": "^15.2.1", "moment-timezone": "^0.5.43", "prettier": "^2.2.0", "react": "^19.0.0", "react-dom": "^19.0.0", - "react-test-renderer": "^18.1.0", "semantic-release": "^19.0.5", "stream-chat": "^8.47.1", - "ts-jest": "^29.1.4", + "ts-jest": "^29.2.5", "typescript": "^5.4.5" }, "scripts": { diff --git a/src/components/Attachment/__tests__/AttachmentActions.test.js b/src/components/Attachment/__tests__/AttachmentActions.test.js index b864614af..9fb11d6fc 100644 --- a/src/components/Attachment/__tests__/AttachmentActions.test.js +++ b/src/components/Attachment/__tests__/AttachmentActions.test.js @@ -2,7 +2,6 @@ import React from 'react'; import '@testing-library/jest-dom'; import { fireEvent, render, waitFor } from '@testing-library/react'; -import renderer from 'react-test-renderer'; import { nanoid } from 'nanoid'; import { AttachmentActions } from '../AttachmentActions'; @@ -22,16 +21,14 @@ const actions = [ describe('AttachmentActions', () => { it('should render AttachmentActions component', () => { - const tree = renderer - .create( - getComponent({ - actionHandler: jest.fn(), - actions, - id: nanoid(), - }), - ) - .toJSON(); - expect(tree).toMatchSnapshot(); + const { container } = render( + getComponent({ + actionHandler: jest.fn(), + actions, + id: nanoid(), + }), + ); + expect(container).toMatchSnapshot(); }); it('should call actionHandler on click', async () => { const actionHandler = jest.fn(); diff --git a/src/components/Attachment/__tests__/File.test.js b/src/components/Attachment/__tests__/File.test.js index 31df22475..66a6750bd 100644 --- a/src/components/Attachment/__tests__/File.test.js +++ b/src/components/Attachment/__tests__/File.test.js @@ -1,6 +1,6 @@ import React from 'react'; +import { render } from '@testing-library/react'; import '@testing-library/jest-dom'; -import renderer from 'react-test-renderer'; import { FileAttachment } from '../FileAttachment'; import { TranslationContext } from '../../../context'; @@ -23,7 +23,7 @@ const file = { describe('File', () => { it('should render File component', () => { - const tree = renderer.create(getComponent({ attachment: file })).toJSON(); - expect(tree).toMatchSnapshot(); + const { container } = render(getComponent({ attachment: file })); + expect(container).toMatchSnapshot(); }); }); diff --git a/src/components/Attachment/__tests__/__snapshots__/AttachmentActions.test.js.snap b/src/components/Attachment/__tests__/__snapshots__/AttachmentActions.test.js.snap index 8cb2583c7..0f877b6b7 100644 --- a/src/components/Attachment/__tests__/__snapshots__/AttachmentActions.test.js.snap +++ b/src/components/Attachment/__tests__/__snapshots__/AttachmentActions.test.js.snap @@ -1,29 +1,29 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`AttachmentActions should render AttachmentActions component 1`] = ` -
+
- - - + + + +
`; diff --git a/src/components/Attachment/__tests__/__snapshots__/File.test.js.snap b/src/components/Attachment/__tests__/__snapshots__/File.test.js.snap index 34716feee..9dc38bc5c 100644 --- a/src/components/Attachment/__tests__/__snapshots__/File.test.js.snap +++ b/src/components/Attachment/__tests__/__snapshots__/File.test.js.snap @@ -1,82 +1,84 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`File should render File component 1`] = ` -
- - - - - - - +
+ + + + + + +
- Nice file +
+ Nice file +
+ + + + +
- - - - - + 1.31 kB +
- - 1.31 kB -
`; diff --git a/src/components/Avatar/__tests__/Avatar.test.js b/src/components/Avatar/__tests__/Avatar.test.js index b45990d7c..4e0805a4b 100644 --- a/src/components/Avatar/__tests__/Avatar.test.js +++ b/src/components/Avatar/__tests__/Avatar.test.js @@ -1,5 +1,5 @@ import React from 'react'; -import renderer from 'react-test-renderer'; + import { cleanup, fireEvent, render } from '@testing-library/react'; import '@testing-library/jest-dom'; @@ -13,49 +13,48 @@ afterEach(cleanup); // eslint-disable-line describe('Avatar', () => { it('should render component with default props', () => { - const tree = renderer.create().toJSON(); - expect(tree).toMatchInlineSnapshot(` -
- ); + expect(container).toMatchInlineSnapshot(` +
+
- - + + + +
`); }); it('should render component with default props and image prop', () => { - const tree = renderer.create().toJSON(); - expect(tree).toMatchInlineSnapshot(` -
- + const { container } = render(); + expect(container).toMatchInlineSnapshot(` +
+
+ +
`); }); diff --git a/src/components/Channel/__tests__/Channel.test.js b/src/components/Channel/__tests__/Channel.test.js index 298a0f4fc..4668c5b16 100644 --- a/src/components/Channel/__tests__/Channel.test.js +++ b/src/components/Channel/__tests__/Channel.test.js @@ -423,7 +423,7 @@ describe('Channel', () => { expect.objectContaining({ error: watchError, }), - expect.any(Object), + undefined, ), ); }); diff --git a/src/components/Channel/__tests__/useIsMounted.test.js b/src/components/Channel/__tests__/useIsMounted.test.js index 87cddee39..3b04528f1 100644 --- a/src/components/Channel/__tests__/useIsMounted.test.js +++ b/src/components/Channel/__tests__/useIsMounted.test.js @@ -1,4 +1,4 @@ -import { act, renderHook } from '@testing-library/react-hooks'; +import { act, renderHook } from '@testing-library/react'; import { useIsMounted } from '../hooks/useIsMounted'; describe('useIsMounted hook', () => { diff --git a/src/components/ChannelList/__tests__/ChannelList.test.js b/src/components/ChannelList/__tests__/ChannelList.test.js index b576b0c52..a7f048b1c 100644 --- a/src/components/ChannelList/__tests__/ChannelList.test.js +++ b/src/components/ChannelList/__tests__/ChannelList.test.js @@ -630,31 +630,34 @@ describe('ChannelList', () => { ]); }); - const renderComponents = (chatContext = {}, channeListProps) => - render( - - - - - , + const renderComponents = async (chatContext = {}, channeListProps) => + await act( + async () => + await render( + + + + + , + ), ); it("should not render search results on input focus if user haven't started to type", async () => { const { container } = await renderComponents({ channel, client }); const input = screen.queryByTestId('search-input'); - await act(() => { - fireEvent.focus(input); + await act(async () => { + await fireEvent.focus(input); }); await waitFor(() => { @@ -668,8 +671,8 @@ describe('ChannelList', () => { { additionalChannelSearchProps: { popupResults: true } }, ); const input = screen.queryByTestId('search-input'); - await act(() => { - fireEvent.change(input, { + await act(async () => { + await fireEvent.change(input, { target: { value: inputText, }, @@ -688,8 +691,8 @@ describe('ChannelList', () => { { additionalChannelSearchProps: { popupResults: false } }, ); const input = screen.queryByTestId('search-input'); - await act(() => { - fireEvent.change(input, { + await act(async () => { + await fireEvent.change(input, { target: { value: inputText, }, @@ -716,8 +719,8 @@ describe('ChannelList', () => { { additionalChannelSearchProps: { clearSearchOnClickOutside } }, ); const input = screen.getByTestId('search-input'); - await act(() => { - fireEvent.change(input, { + await act(async () => { + await fireEvent.change(input, { target: { value: inputText, }, @@ -728,8 +731,8 @@ describe('ChannelList', () => { }); const searchResults = screen.queryAllByTestId('channel-search-result-user'); useMockedApis(client, [getOrCreateChannelApi(generateChannel())]); - await act(() => { - fireEvent.click(searchResults[0]); + await act(async () => { + await fireEvent.click(searchResults[0]); }); await waitFor(() => { @@ -746,18 +749,18 @@ describe('ChannelList', () => { it('should unmount search results if user cleared the input', async () => { const { container } = await renderComponents({ channel, client }); const input = screen.queryByTestId('search-input'); - await act(() => { + await act(async () => { input.focus(); - fireEvent.change(input, { + await fireEvent.change(input, { target: { value: inputText, }, }); }); - await act(() => { + await act(async () => { const clearButton = screen.queryByTestId('clear-input-button'); - fireEvent.click(clearButton); + await fireEvent.click(clearButton); }); await waitFor(() => { expect(container.querySelector(SEARCH_RESULT_LIST_SELECTOR)).not.toBeInTheDocument(); @@ -772,9 +775,9 @@ describe('ChannelList', () => { const { container } = await renderComponents({ channel, client }); const input = screen.queryByTestId('search-input'); - await act(() => { + await act(async () => { input.focus(); - fireEvent.change(input, { + await fireEvent.change(input, { target: { value: inputText, }, @@ -782,8 +785,8 @@ describe('ChannelList', () => { }); const returnIcon = screen.queryByTestId('return-icon'); - await act(() => { - fireEvent.click(returnIcon); + await act(async () => { + await fireEvent.click(returnIcon); }); await waitFor(() => { expect(container.querySelector(SEARCH_RESULT_LIST_SELECTOR)).not.toBeInTheDocument(); @@ -795,16 +798,18 @@ describe('ChannelList', () => { it('should add the selected result to the top of the channel list', async () => { jest.useFakeTimers('modern'); jest.spyOn(client, 'queryUsers').mockResolvedValue({ users: [generateUser()] }); - await render( - - - , - ); + await act(async () => { + await render( + + + , + ); + }); const channelNotInTheList = generateChannel({ channel: { name: 'channel-not-loaded-yet' }, @@ -831,8 +836,8 @@ describe('ChannelList', () => { const targetChannelPreview = screen.getByText(channelNotInTheList.channel.name); expect(targetChannelPreview).toBeInTheDocument(); - await act(() => { - fireEvent.click(targetChannelPreview); + await act(async () => { + await fireEvent.click(targetChannelPreview); }); await waitFor(() => { @@ -853,7 +858,7 @@ describe('ChannelList', () => { Preview: ChannelPreviewComponent, renderChannels, }; - const { container, getByRole } = render( + const { container, getByRole } = await render( , @@ -894,7 +899,7 @@ describe('ChannelList', () => { }); it('should move channel to top of the list', async () => { - const { container, getAllByRole, getByRole, getByText } = render( + const { container, getAllByRole, getByRole, getByText } = await render( , @@ -920,7 +925,7 @@ describe('ChannelList', () => { }); it('should not alter order if `lockChannelOrder` prop is true', async () => { - const { container, getAllByRole, getByRole, getByText } = render( + const { container, getAllByRole, getByRole, getByText } = await render( , @@ -973,7 +978,7 @@ describe('ChannelList', () => { it('should move channel to top of the list by default', async () => { useMockedApis(chatClient, [queryChannelsApi([testChannel1, testChannel2])]); - const { container, getAllByRole, getByRole, getByTestId } = render( + const { container, getAllByRole, getByRole, getByTestId } = await render( { useMockedApis(chatClient, [queryChannelsApi([testChannel1])]); - const { container, getByRole } = render( + const { container, getByRole } = await render( { }); it('should move channel to top of the list by default', async () => { - const { container, getAllByRole, getByRole, getByTestId } = render( + const { container, getAllByRole, getByRole, getByTestId } = await render( , @@ -1084,7 +1089,7 @@ describe('ChannelList', () => { it('should call `onAddedToChannel` function prop, if provided', async () => { const onAddedToChannel = jest.fn(); - const { container, getByRole } = render( + const { container, getByRole } = await render( , @@ -1117,7 +1122,7 @@ describe('ChannelList', () => { }); it('should remove the channel from list by default', async () => { - const { container, getByRole, getByTestId } = render( + const { container, getByRole, getByTestId } = await render( , @@ -1139,7 +1144,7 @@ describe('ChannelList', () => { it('should call `onRemovedFromChannel` function prop, if provided', async () => { const onRemovedFromChannel = jest.fn(); - const { container, getByRole } = render( + const { container, getByRole } = await render( , @@ -1171,7 +1176,7 @@ describe('ChannelList', () => { }); it('should update the channel in list, by default', async () => { - const { container, getByRole, getByText } = render( + const { container, getByRole, getByText } = await render( , @@ -1199,7 +1204,7 @@ describe('ChannelList', () => { it('should call `onChannelUpdated` function prop, if provided', async () => { const onChannelUpdated = jest.fn(); - const { container, getByRole } = render( + const { container, getByRole } = await render( , @@ -1239,7 +1244,7 @@ describe('ChannelList', () => { }); it('should remove channel from list, by default', async () => { - const { container, getByRole, getByTestId } = render( + const { container, getByRole, getByTestId } = await render( , @@ -1262,7 +1267,7 @@ describe('ChannelList', () => { it('should call `onChannelDeleted` function prop, if provided', async () => { const onChannelDeleted = jest.fn(); - const { container, getByRole } = render( + const { container, getByRole } = await render( , @@ -1284,7 +1289,7 @@ describe('ChannelList', () => { it('should unset activeChannel if it was deleted', async () => { const setActiveChannel = jest.fn(); - const { container, getByRole } = render( + const { container, getByRole } = await render( { }); it('should remove channel from list, by default', async () => { - const { container, getByRole, getByTestId } = render( + const { container, getByRole, getByTestId } = await render( , @@ -1350,7 +1355,7 @@ describe('ChannelList', () => { it('should unset activeChannel if it was hidden', async () => { const setActiveChannel = jest.fn(); - const { container, getByRole } = render( + const { container, getByRole } = await render( { }); it('should move channel to top of the list by default', async () => { - const { container, getAllByRole, getByRole, getByTestId } = render( + const { container, getAllByRole, getByRole, getByTestId } = await render( , @@ -1425,7 +1430,7 @@ describe('ChannelList', () => { it('should call `onChannelVisible` function prop, if provided', async () => { const onChannelVisible = jest.fn(); - const { container, getByRole } = render( + const { container, getByRole } = await render( , @@ -1458,7 +1463,7 @@ describe('ChannelList', () => { useMockedApis(chatClient, [queryChannelsApi([channel1])]); - const { container, getByRole, getByTestId } = render( + const { container, getByRole, getByTestId } = await render( , @@ -1505,7 +1510,7 @@ describe('ChannelList', () => { it('should call `onChannelTruncated` function prop, if provided', async () => { const onChannelTruncated = jest.fn(); - const { container, getByRole } = render( + const { container, getByRole } = await render( , diff --git a/src/components/ChannelList/__tests__/ChannelListMessenger.test.js b/src/components/ChannelList/__tests__/ChannelListMessenger.test.js index 804f01dbe..7a947b3f0 100644 --- a/src/components/ChannelList/__tests__/ChannelListMessenger.test.js +++ b/src/components/ChannelList/__tests__/ChannelListMessenger.test.js @@ -1,7 +1,6 @@ import React from 'react'; -import { cleanup } from '@testing-library/react'; +import { cleanup, render } from '@testing-library/react'; import '@testing-library/jest-dom'; -import renderer from 'react-test-renderer'; import { ChannelListMessenger } from '../ChannelListMessenger'; import { TranslationProvider } from '../../../context'; @@ -29,15 +28,15 @@ describe('ChannelListMessenger', () => { afterEach(cleanup); it('by default, children should be rendered', () => { - const tree = renderer.create().toJSON(); - expect(tree).toMatchSnapshot(); + const { container } = render(); + expect(container).toMatchSnapshot(); }); it('when `error` prop is true, `LoadingErrorIndicator` should be rendered', () => { - const tree = renderer.create().toJSON(); - expect(tree).toMatchSnapshot(); + const { container } = render(); + expect(container).toMatchSnapshot(); }); it('when `loading` prop is true, `LoadingIndicator` should be rendered', () => { - const tree = renderer.create().toJSON(); - expect(tree).toMatchSnapshot(); + const { container } = render(); + expect(container).toMatchSnapshot(); }); }); diff --git a/src/components/ChannelList/__tests__/__snapshots__/ChannelListMessenger.test.js.snap b/src/components/ChannelList/__tests__/__snapshots__/ChannelListMessenger.test.js.snap index 4691ce5b2..55e94dac3 100644 --- a/src/components/ChannelList/__tests__/__snapshots__/ChannelListMessenger.test.js.snap +++ b/src/components/ChannelList/__tests__/__snapshots__/ChannelListMessenger.test.js.snap @@ -1,19 +1,21 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`ChannelListMessenger by default, children should be rendered 1`] = ` -
+
-
- children 1 -
-
- children 2 +
+
+ children 1 +
+
+ children 2 +
@@ -21,12 +23,16 @@ exports[`ChannelListMessenger by default, children should be rendered 1`] = ` exports[`ChannelListMessenger when \`error\` prop is true, \`LoadingErrorIndicator\` should be rendered 1`] = `
- Loading Error Indicator +
+ Loading Error Indicator +
`; exports[`ChannelListMessenger when \`loading\` prop is true, \`LoadingIndicator\` should be rendered 1`] = `
- Loading Indicator +
+ Loading Indicator +
`; diff --git a/src/components/ChannelPreview/__tests__/ChannelPreviewMessenger.test.js b/src/components/ChannelPreview/__tests__/ChannelPreviewMessenger.test.js index f60e5fb29..c523e1edc 100644 --- a/src/components/ChannelPreview/__tests__/ChannelPreviewMessenger.test.js +++ b/src/components/ChannelPreview/__tests__/ChannelPreviewMessenger.test.js @@ -1,7 +1,6 @@ import React from 'react'; import { fireEvent, render, screen, waitFor } from '@testing-library/react'; import '@testing-library/jest-dom'; -import renderer from 'react-test-renderer'; import { toHaveNoViolations } from 'jest-axe'; import { axe } from '../../../../axe-helper'; import { @@ -55,8 +54,8 @@ describe('ChannelPreviewMessenger', () => { }); it('should render correctly', () => { - const tree = renderer.create(renderComponent()).toJSON(); - expect(tree).toMatchSnapshot(); + const { container } = render(renderComponent()); + expect(container).toMatchSnapshot(); }); it('should call setActiveChannel on click', async () => { diff --git a/src/components/ChannelPreview/__tests__/__snapshots__/ChannelPreviewMessenger.test.js.snap b/src/components/ChannelPreview/__tests__/__snapshots__/ChannelPreviewMessenger.test.js.snap index c2179627c..8d5e931b1 100644 --- a/src/components/ChannelPreview/__tests__/__snapshots__/ChannelPreviewMessenger.test.js.snap +++ b/src/components/ChannelPreview/__tests__/__snapshots__/ChannelPreviewMessenger.test.js.snap @@ -1,105 +1,101 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`ChannelPreviewMessenger should render correctly 1`] = ` -
+
- - + -
- +
+
-
- - Channel name - +
+ + Channel name + +
+
+ 10 +
- 10 + Latest message!
-
- Latest message! -
-
- + +
`; diff --git a/src/components/ChannelPreview/hooks/__tests__/useMessageDeliveryStatus.test.js b/src/components/ChannelPreview/hooks/__tests__/useMessageDeliveryStatus.test.js index d8b25470e..94a44f8b1 100644 --- a/src/components/ChannelPreview/hooks/__tests__/useMessageDeliveryStatus.test.js +++ b/src/components/ChannelPreview/hooks/__tests__/useMessageDeliveryStatus.test.js @@ -1,5 +1,5 @@ import React from 'react'; -import { renderHook } from '@testing-library/react-hooks'; +import { renderHook } from '@testing-library/react'; import { MessageDeliveryStatus, useMessageDeliveryStatus } from '../useMessageDeliveryStatus'; import { ChatContext } from '../../../../context'; import { diff --git a/src/components/ChannelSearch/__tests__/ChannelSearch.test.js b/src/components/ChannelSearch/__tests__/ChannelSearch.test.js index 1325bfdf3..dacbe5048 100644 --- a/src/components/ChannelSearch/__tests__/ChannelSearch.test.js +++ b/src/components/ChannelSearch/__tests__/ChannelSearch.test.js @@ -109,7 +109,7 @@ describe('ChannelSearch', () => { }); it('removes "searching" flag upon setting search results', async () => { - jest.useFakeTimers('modern'); + jest.useFakeTimers(); const client = await getTestClientWithUser(user); useMockedApis(client, [queryUsersApi([user])]); const { typeText } = await renderSearch({ client }); @@ -117,7 +117,11 @@ describe('ChannelSearch', () => { typeText(typedText); }); expect(screen.queryByTestId(TEST_ID.SEARCH_IN_PROGRESS_INDICATOR)).toBeInTheDocument(); - jest.advanceTimersByTime(1000); + + await act(() => { + jest.advanceTimersByTime(1000); + }); + await waitFor(() => { expect(screen.queryByTestId(TEST_ID.SEARCH_IN_PROGRESS_INDICATOR)).not.toBeInTheDocument(); }); diff --git a/src/components/ChannelSearch/__tests__/SearchBar.test.js b/src/components/ChannelSearch/__tests__/SearchBar.test.js index 0f5f8f5ac..ad23f7107 100644 --- a/src/components/ChannelSearch/__tests__/SearchBar.test.js +++ b/src/components/ChannelSearch/__tests__/SearchBar.test.js @@ -1,6 +1,6 @@ import React from 'react'; import { act, fireEvent, render, screen, waitFor } from '@testing-library/react'; -import renderer from 'react-test-renderer'; + import '@testing-library/jest-dom'; import { SearchBar } from '../SearchBar'; @@ -68,20 +68,18 @@ describe('SearchBar', () => { }); it('should render default layout', () => { expect( - renderer - .create( - , - ) - .toJSON(), + render( + , + ).container, ).toMatchSnapshot(); }); it.each([ diff --git a/src/components/ChannelSearch/__tests__/__snapshots__/SearchBar.test.js.snap b/src/components/ChannelSearch/__tests__/__snapshots__/SearchBar.test.js.snap index 7adfd27fe..0357da5ff 100644 --- a/src/components/ChannelSearch/__tests__/__snapshots__/SearchBar.test.js.snap +++ b/src/components/ChannelSearch/__tests__/__snapshots__/SearchBar.test.js.snap @@ -1,56 +1,56 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`SearchBar should render default layout 1`] = ` -
+
+ + + + + + +
`; diff --git a/src/components/CommandItem/__tests__/CommandItem.test.js b/src/components/CommandItem/__tests__/CommandItem.test.js index fceb833cb..41f8195a2 100644 --- a/src/components/CommandItem/__tests__/CommandItem.test.js +++ b/src/components/CommandItem/__tests__/CommandItem.test.js @@ -1,5 +1,5 @@ import React from 'react'; -import renderer from 'react-test-renderer'; + import { cleanup, render } from '@testing-library/react'; import '@testing-library/jest-dom'; @@ -9,21 +9,23 @@ afterEach(cleanup); // eslint-disable-line describe('commandItem', () => { it('should render component with empty entity', () => { - const tree = renderer.create().toJSON(); - expect(tree).toMatchInlineSnapshot(` -
- ); + expect(container).toMatchInlineSnapshot(` +
+
- - - -
- + + + + +
+ +
`); }); @@ -37,26 +39,28 @@ describe('commandItem', () => { expect(getByText(entity.args)).toBeInTheDocument(); expect(getByText(entity.description)).toBeInTheDocument(); - const tree = renderer.create(Component).toJSON(); - expect(tree).toMatchInlineSnapshot(` -
- - - name - - - args - -
- +
- description - + + + name + + + args + +
+ + description + +
`); }); diff --git a/src/components/DateSeparator/__tests__/DateSeparator.test.js b/src/components/DateSeparator/__tests__/DateSeparator.test.js index bcd549043..22926d7af 100644 --- a/src/components/DateSeparator/__tests__/DateSeparator.test.js +++ b/src/components/DateSeparator/__tests__/DateSeparator.test.js @@ -1,5 +1,5 @@ import React from 'react'; -import renderer from 'react-test-renderer'; + import Dayjs from 'dayjs'; import calendar from 'dayjs/plugin/calendar'; import { act, cleanup, render, screen } from '@testing-library/react'; @@ -180,65 +180,85 @@ describe('DateSeparator', () => { ); - const defaultPosition = renderer.create(renderWithPosition()).toJSON(); - it('should render correctly with position==="right", and it should match the default', () => { - const tree = renderer.create(renderWithPosition('right')).toJSON(); - expect(tree).toMatchInlineSnapshot(` -
-
+ const { container } = render(renderWithPosition('right')); + expect(container).toMatchInlineSnapshot(` +
+
+
+
+ the date +
+
+
+ `); + expect(render(renderWithPosition()).container).toMatchInlineSnapshot(` +
- the date +
+
+ the date +
`); - expect(defaultPosition).toStrictEqual(tree); }); it('should render correctly with position==="left"', () => { - const tree = renderer.create(renderWithPosition('left')).toJSON(); - expect(tree).toMatchInlineSnapshot(` -
+ const { container } = render(renderWithPosition('left')); + expect(container).toMatchInlineSnapshot(` +
- the date +
+ the date +
+
-
`); }); it('should render correctly with position==="center"', () => { - const tree = renderer.create(renderWithPosition('center')).toJSON(); - expect(tree).toMatchInlineSnapshot(` -
-
+ const { container } = render(renderWithPosition('center')); + expect(container).toMatchInlineSnapshot(` +
- the date +
+
+ the date +
+
-
`); }); diff --git a/src/components/EmoticonItem/__tests__/EmoticonItem.test.js b/src/components/EmoticonItem/__tests__/EmoticonItem.test.js index 0ac8822c9..05e78d283 100644 --- a/src/components/EmoticonItem/__tests__/EmoticonItem.test.js +++ b/src/components/EmoticonItem/__tests__/EmoticonItem.test.js @@ -1,5 +1,5 @@ import React from 'react'; -import renderer from 'react-test-renderer'; + import { cleanup, render, waitFor } from '@testing-library/react'; import '@testing-library/jest-dom'; @@ -9,17 +9,19 @@ afterEach(cleanup); // eslint-disable-line describe('EmoticonItem', () => { it('should render component with empty entity', () => { - const tree = renderer.create().toJSON(); - expect(tree).toMatchInlineSnapshot(` -
- - + const { container } = render(); + expect(container).toMatchInlineSnapshot(` +
+
+ + +
`); }); @@ -37,30 +39,32 @@ describe('EmoticonItem', () => { expect(getByText(entity.native)).toBeInTheDocument(); }); - const tree = renderer.create(Component).toJSON(); - expect(tree).toMatchInlineSnapshot(` -
- - native - - +
- n + native - ame + + n + + + ame + - +
`); }); diff --git a/src/components/EmptyStateIndicator/__tests__/EmptyStateIndicator.test.js b/src/components/EmptyStateIndicator/__tests__/EmptyStateIndicator.test.js index 4e2703f3d..89cd56236 100644 --- a/src/components/EmptyStateIndicator/__tests__/EmptyStateIndicator.test.js +++ b/src/components/EmptyStateIndicator/__tests__/EmptyStateIndicator.test.js @@ -1,5 +1,5 @@ import React from 'react'; -import renderer from 'react-test-renderer'; + import { cleanup, render, screen } from '@testing-library/react'; import '@testing-library/jest-dom'; @@ -10,11 +10,13 @@ afterEach(cleanup); // eslint-disable-line describe('EmptyStateIndicator', () => { it('should render with default props', () => { jest.spyOn(console, 'error').mockImplementationOnce(() => null); - const tree = renderer.create().toJSON(); - expect(tree).toMatchInlineSnapshot(` -

- No items exist -

+ const { container } = render(); + expect(container).toMatchInlineSnapshot(` +
+

+ No items exist +

+
`); }); diff --git a/src/components/EventComponent/__tests__/EventComponent.test.js b/src/components/EventComponent/__tests__/EventComponent.test.js index 11c6230e0..90a5f65e5 100644 --- a/src/components/EventComponent/__tests__/EventComponent.test.js +++ b/src/components/EventComponent/__tests__/EventComponent.test.js @@ -1,5 +1,5 @@ import React from 'react'; -import renderer from 'react-test-renderer'; + import { act, cleanup, render, screen } from '@testing-library/react'; import '@testing-library/jest-dom'; @@ -37,8 +37,8 @@ describe('EventComponent', () => { }; it('should render null for empty message', () => { - const tree = renderer.create().toJSON(); - expect(tree).toMatchInlineSnapshot(`null`); + const { container } = render(); + expect(container).toBeEmptyDOMElement(); }); it('should render system events', async () => { @@ -187,28 +187,30 @@ describe('EventComponent', () => { type: 'channel.event', }; - const tree = renderer.create().toJSON(); - expect(tree).toMatchInlineSnapshot(` -
- + const { container } = render(); + expect(container).toMatchInlineSnapshot(` +
- - user_id has joined the chat - +
- 6:18 PM + + user_id has joined the chat + +
+ 6:18 PM +
@@ -225,28 +227,30 @@ describe('EventComponent', () => { type: 'channel.event', }; - const tree = renderer.create().toJSON(); - expect(tree).toMatchInlineSnapshot(` -
- + const { container } = render(); + expect(container).toMatchInlineSnapshot(` +
- - user_id was removed from the chat - +
- 6:18 PM + + user_id was removed from the chat + +
+ 6:18 PM +
diff --git a/src/components/Gallery/__tests__/Gallery.test.js b/src/components/Gallery/__tests__/Gallery.test.js index 7b7773bdb..57cd66439 100644 --- a/src/components/Gallery/__tests__/Gallery.test.js +++ b/src/components/Gallery/__tests__/Gallery.test.js @@ -1,6 +1,6 @@ import React, { useEffect } from 'react'; import { nanoid } from 'nanoid'; -import renderer from 'react-test-renderer'; + import { act, cleanup, fireEvent, render, waitFor } from '@testing-library/react'; import '@testing-library/jest-dom'; @@ -47,47 +47,39 @@ describe('Gallery', () => { afterEach(cleanup); it('should render component with default props', () => { - const tree = renderer - .create( - - - , - ) - .toJSON(); - expect(tree).toMatchSnapshot(); + const { container } = render( + + + , + ); + expect(container).toMatchSnapshot(); }); it('should render component with 3 images', () => { - const tree = renderer - .create( - - - , - ) - .toJSON(); - expect(tree).toMatchSnapshot(); + const { container } = render( + + + , + ); + expect(container).toMatchSnapshot(); }); it('should render component with 4 images', () => { - const tree = renderer - .create( - - - , - ) - .toJSON(); - expect(tree).toMatchSnapshot(); + const { container } = render( + + + , + ); + expect(container).toMatchSnapshot(); }); it('should render component with 5 images', () => { - const tree = renderer - .create( - - - , - ) - .toJSON(); - expect(tree).toMatchSnapshot(); + const { container } = render( + + + , + ); + expect(container).toMatchSnapshot(); }); it('should open modal on image click', async () => { diff --git a/src/components/Gallery/__tests__/Image.test.js b/src/components/Gallery/__tests__/Image.test.js index 64c83b178..2964a7fb7 100644 --- a/src/components/Gallery/__tests__/Image.test.js +++ b/src/components/Gallery/__tests__/Image.test.js @@ -1,5 +1,5 @@ import React, { useEffect } from 'react'; -import renderer from 'react-test-renderer'; + import { act, cleanup, fireEvent, render, waitFor } from '@testing-library/react'; import '@testing-library/jest-dom'; @@ -19,14 +19,12 @@ describe('Image', () => { afterEach(cleanup); it('should render component with default props', () => { - const tree = renderer - .create( - - - , - ) - .toJSON(); - expect(tree).toMatchSnapshot(); + const { container } = render( + + + , + ); + expect(container).toMatchSnapshot(); }); describe('it should prevent unsafe image uri protocols in the rendered image src', () => { diff --git a/src/components/Gallery/__tests__/__snapshots__/Gallery.test.js.snap b/src/components/Gallery/__tests__/__snapshots__/Gallery.test.js.snap index f14e5ee16..33562fa1c 100644 --- a/src/components/Gallery/__tests__/__snapshots__/Gallery.test.js.snap +++ b/src/components/Gallery/__tests__/__snapshots__/Gallery.test.js.snap @@ -1,212 +1,191 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Gallery should render component with 3 images 1`] = ` -
- - - + + + +
`; exports[`Gallery should render component with 4 images 1`] = ` -
- - - - + + + + +
`; exports[`Gallery should render component with 5 images 1`] = ` -
- - - - + + + + +
`; exports[`Gallery should render component with default props 1`] = ` -
- - + + +
`; diff --git a/src/components/Gallery/__tests__/__snapshots__/Image.test.js.snap b/src/components/Gallery/__tests__/__snapshots__/Image.test.js.snap index 748e9939d..cadf9a20e 100644 --- a/src/components/Gallery/__tests__/__snapshots__/Image.test.js.snap +++ b/src/components/Gallery/__tests__/__snapshots__/Image.test.js.snap @@ -1,12 +1,12 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Image should render component with default props 1`] = ` - +
+ +
`; diff --git a/src/components/InfiniteScrollPaginator/__tests__/InfiniteScroll.test.js b/src/components/InfiniteScrollPaginator/__tests__/InfiniteScroll.test.js index 206768fd2..8df5fd369 100644 --- a/src/components/InfiniteScrollPaginator/__tests__/InfiniteScroll.test.js +++ b/src/components/InfiniteScrollPaginator/__tests__/InfiniteScroll.test.js @@ -1,7 +1,6 @@ import React from 'react'; import { fireEvent, render } from '@testing-library/react'; import '@testing-library/jest-dom'; -import renderer from 'react-test-renderer'; import { InfiniteScroll } from '../'; @@ -112,24 +111,25 @@ describe('InfiniteScroll', () => { describe('Rendering loader', () => { const getRenderResult = () => - renderer - .create( - loader
} - loadPreviousPage={loadPreviousPage} - > - Content - , - ) - .toJSON(); + render( + loader
} + loadPreviousPage={loadPreviousPage} + > + Content + , + ); it('should render the loader in the right place if isLoading is true', () => { - expect(getRenderResult()).toMatchInlineSnapshot(` + const { container } = getRenderResult(); + expect(container).toMatchInlineSnapshot(`
- loader +
+ loader +
+ Content
- Content
`); }); diff --git a/src/components/LoadMore/__tests__/LoadMoreButton.test.js b/src/components/LoadMore/__tests__/LoadMoreButton.test.js index 3669ea990..a08494711 100644 --- a/src/components/LoadMore/__tests__/LoadMoreButton.test.js +++ b/src/components/LoadMore/__tests__/LoadMoreButton.test.js @@ -1,6 +1,5 @@ import React from 'react'; import { cleanup, fireEvent, render, waitFor } from '@testing-library/react'; -import renderer from 'react-test-renderer'; import '@testing-library/jest-dom'; import { LoadMoreButton } from '../LoadMoreButton'; @@ -11,26 +10,24 @@ describe('LoadMoreButton', () => { afterEach(cleanup); it('should render component with default props', () => { - const tree = renderer - .create( - - null} /> - , - ) - .toJSON(); - expect(tree).toMatchInlineSnapshot(` -
- + +
`); }); diff --git a/src/components/LoadMore/__tests__/LoadMorePaginator.test.js b/src/components/LoadMore/__tests__/LoadMorePaginator.test.js index 9927fc387..0e24f73d0 100644 --- a/src/components/LoadMore/__tests__/LoadMorePaginator.test.js +++ b/src/components/LoadMore/__tests__/LoadMorePaginator.test.js @@ -1,5 +1,5 @@ import React from 'react'; -import renderer from 'react-test-renderer'; + import { cleanup, render, waitFor } from '@testing-library/react'; import '@testing-library/jest-dom'; @@ -14,94 +14,90 @@ describe('LoadMorePaginator', () => { afterEach(cleanup); it('should render component with default props', () => { - const tree = renderer - .create(children) - .toJSON(); - expect(tree).toMatchInlineSnapshot(`"children"`); + const { container } = render( + children, + ); + expect(container).toMatchInlineSnapshot(` +
+ children +
+ `); }); it('should render default LoadMoreButton when hasNextPage', () => { - const tree = renderer - .create( - - children - , - ) - .toJSON(); - expect(tree).toMatchInlineSnapshot(` - [ - "children", + const { container } = render( + + children + , + ); + expect(container).toMatchInlineSnapshot(` +
+ children
, - ] + /> +
`); }); it('should render LoadMoreButton prop when hasNextPage 1', () => { - const tree = renderer - .create( -
custom load more button
} - loadNextPage={jest.fn()} - > - children -
, - ) - .toJSON(); - expect(tree).toMatchInlineSnapshot(` - [ - "children", + const { container } = render( +
custom load more button
} + loadNextPage={jest.fn()} + > + children +
, + ); + expect(container).toMatchInlineSnapshot(` +
+ children
custom load more button -
, - ] +
+
`); }); it('should render LoadMoreButton prop when hasNextPage 2', () => { - const tree = renderer - .create( -
load more button
} - loadNextPage={jest.fn()} - > - children -
, - ) - .toJSON(); - expect(tree).toMatchInlineSnapshot(` - [ - "children", + const { container } = render( +
load more button
} + loadNextPage={jest.fn()} + > + children +
, + ); + expect(container).toMatchInlineSnapshot(` +
+ children
load more button -
, - ] +
+
`); }); it('should render children after loader in reverse mode', () => { - const tree = renderer - .create( -
load more button
} - loadNextPage={jest.fn()} - reverse - > - children -
, - ) - .toJSON(); - expect(tree).toMatchInlineSnapshot(` - [ + const { container } = render( +
load more button
} + loadNextPage={jest.fn()} + reverse + > + children +
, + ); + expect(container).toMatchInlineSnapshot(` +
load more button -
, - "children", - ] +
+ children +
`); }); @@ -117,7 +113,7 @@ describe('LoadMorePaginator', () => { await waitFor(() => { expect(LoadMoreButton).toHaveBeenCalledWith( { isLoading: undefined, onClick: undefined, refreshing: undefined }, - {}, + undefined, ); }); }); @@ -139,7 +135,10 @@ describe('LoadMorePaginator', () => { consoleWarnSpy.mockRestore(); await waitFor(() => { - expect(LoadMoreButton).toHaveBeenCalledWith({ isLoading: false, onClick: loadNextPage }, {}); + expect(LoadMoreButton).toHaveBeenCalledWith( + { isLoading: false, onClick: loadNextPage }, + undefined, + ); }); }); }); diff --git a/src/components/Loading/__tests__/LoadingChannels.test.js b/src/components/Loading/__tests__/LoadingChannels.test.js index 5318a3c9d..08d2499e6 100644 --- a/src/components/Loading/__tests__/LoadingChannels.test.js +++ b/src/components/Loading/__tests__/LoadingChannels.test.js @@ -1,6 +1,6 @@ import React from 'react'; -import renderer from 'react-test-renderer'; -import { cleanup } from '@testing-library/react'; + +import { cleanup, render } from '@testing-library/react'; import '@testing-library/jest-dom'; import { LoadingChannels } from '../LoadingChannels'; @@ -9,7 +9,7 @@ afterEach(cleanup); // eslint-disable-line describe('LoadingChannels', () => { it('should render component with default props', () => { - const tree = renderer.create().toJSON(); - expect(tree).toMatchSnapshot(); + const { container } = render(); + expect(container).toMatchSnapshot(); }); }); diff --git a/src/components/Loading/__tests__/LoadingErrorIndicator.test.js b/src/components/Loading/__tests__/LoadingErrorIndicator.test.js index 946e08708..450cc0c66 100644 --- a/src/components/Loading/__tests__/LoadingErrorIndicator.test.js +++ b/src/components/Loading/__tests__/LoadingErrorIndicator.test.js @@ -1,5 +1,5 @@ import React from 'react'; -import renderer from 'react-test-renderer'; + import { cleanup, render, waitFor } from '@testing-library/react'; import '@testing-library/jest-dom'; @@ -18,12 +18,12 @@ describe('LoadingErrorIndicator', () => { }); it('should render when an error is passed', () => { - const tree = renderer - .create() - .toJSON(); - expect(tree).toMatchInlineSnapshot(` + const { container } = render(); + expect(container).toMatchInlineSnapshot(`
- Error: {{ errorMessage }} +
+ Error: {{ errorMessage }} +
`); }); diff --git a/src/components/Loading/__tests__/LoadingIndicator.test.js b/src/components/Loading/__tests__/LoadingIndicator.test.js index 1c87815be..c92caedc2 100644 --- a/src/components/Loading/__tests__/LoadingIndicator.test.js +++ b/src/components/Loading/__tests__/LoadingIndicator.test.js @@ -1,5 +1,5 @@ import React from 'react'; -import renderer from 'react-test-renderer'; + import { cleanup, render, waitFor } from '@testing-library/react'; import '@testing-library/jest-dom'; @@ -9,8 +9,8 @@ afterEach(cleanup); // eslint-disable-line describe('LoadingIndicator', () => { it('should render with default props', () => { - const tree = renderer.create().toJSON(); - expect(tree).toMatchSnapshot(); + const { container } = render(); + expect(container).toMatchSnapshot(); }); it('should update style based on props', () => { diff --git a/src/components/Loading/__tests__/__snapshots__/LoadingChannels.test.js.snap b/src/components/Loading/__tests__/__snapshots__/LoadingChannels.test.js.snap index 4f2cdc715..c4c3d26c0 100644 --- a/src/components/Loading/__tests__/__snapshots__/LoadingChannels.test.js.snap +++ b/src/components/Loading/__tests__/__snapshots__/LoadingChannels.test.js.snap @@ -1,58 +1,60 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`LoadingChannels should render component with default props 1`] = ` -
+
-
+ class="str-chat__loading-channels-meta str-chat__channel-preview-end-loading" + > +
+
+
-
-
-
+ class="str-chat__loading-channels-meta str-chat__channel-preview-end-loading" + > +
+
+
-
-
-
+ class="str-chat__loading-channels-meta str-chat__channel-preview-end-loading" + > +
+
+
diff --git a/src/components/Loading/__tests__/__snapshots__/LoadingIndicator.test.js.snap b/src/components/Loading/__tests__/__snapshots__/LoadingIndicator.test.js.snap index 110c8944e..59793154c 100644 --- a/src/components/Loading/__tests__/__snapshots__/LoadingIndicator.test.js.snap +++ b/src/components/Loading/__tests__/__snapshots__/LoadingIndicator.test.js.snap @@ -1,53 +1,46 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`LoadingIndicator should render with default props 1`] = ` -
- +
- - - - - - - - + + + + + + + + + +
`; diff --git a/src/components/MML/__tests__/MML.test.js b/src/components/MML/__tests__/MML.test.js index 932c36db5..4ad8e88c5 100644 --- a/src/components/MML/__tests__/MML.test.js +++ b/src/components/MML/__tests__/MML.test.js @@ -1,5 +1,5 @@ import React from 'react'; -import renderer from 'react-test-renderer'; + import { act, cleanup, fireEvent, render, screen, waitFor } from '@testing-library/react'; import '@testing-library/jest-dom'; @@ -9,13 +9,10 @@ import { MessageProvider } from '../../../context/MessageContext'; afterEach(cleanup); // eslint-disable-line -const renderComponent = async ( - { chatCtx = {}, messageCtx = {}, mmlProps }, - _renderer = renderer.create, -) => { +const renderComponent = async ({ chatCtx = {}, messageCtx = {}, mmlProps }) => { let result; await act(() => { - result = _renderer( + result = render( @@ -28,53 +25,52 @@ const renderComponent = async ( describe('MML', () => { it('should render mml form without any source', async () => { - const tree = await renderComponent({ mmlProps: { source: '' } }); - expect(tree.toJSON()).toMatchInlineSnapshot(` -
-
+ const { container } = await renderComponent({ mmlProps: { source: '' } }); + expect(container).toMatchInlineSnapshot(` +
+
+ +
`); }, 10000); it('should render a basic mml', async () => { - const tree = await renderComponent({ + const { container } = await renderComponent({ mmlProps: { source: 'Some Text' }, }); - expect(tree.toJSON()).toMatchInlineSnapshot(` -
- +
-
- Some Text -
- +
+ Some Text +
+ +
`); }); it('should render with different align prop', async () => { - const { rerender } = await renderComponent( - { - mmlProps: { align: 'left', source: '' }, - }, - render, - ); + const { rerender } = await renderComponent({ + mmlProps: { align: 'left', source: '' }, + }); expect(screen.getByTestId('mml-container')).toHaveClass('mml-align-left'); @@ -89,25 +85,19 @@ describe('MML', () => { }); it('should pass down themes from chat context', async () => { - await renderComponent( - { - chatCtx: { theme: 'team dark' }, - mmlProps: { source: '' }, - }, - render, - ); + await renderComponent({ + chatCtx: { theme: 'team dark' }, + mmlProps: { source: '' }, + }); expect(screen.getByTestId('mml-container')).toHaveClass('team-dark'); }); it('actionHandler should be called', async () => { const handler = jest.fn(); - await renderComponent( - { - mmlProps: { actionHandler: handler, source: '' }, - }, - render, - ); + await renderComponent({ + mmlProps: { actionHandler: handler, source: '' }, + }); expect(handler).toHaveBeenCalledTimes(0); act(() => { @@ -122,15 +112,12 @@ describe('MML', () => { it('actionHandler should be called with data', async () => { const handler = jest.fn(); - await renderComponent( - { - mmlProps: { - actionHandler: handler, - source: "", - }, + await renderComponent({ + mmlProps: { + actionHandler: handler, + source: "", }, - render, - ); + }); expect(handler).toHaveBeenCalledTimes(0); act(() => { diff --git a/src/components/MediaRecorder/hooks/__tests__/useMediaRecorder.test.js b/src/components/MediaRecorder/hooks/__tests__/useMediaRecorder.test.js index d33922e7e..d63a3ab5d 100644 --- a/src/components/MediaRecorder/hooks/__tests__/useMediaRecorder.test.js +++ b/src/components/MediaRecorder/hooks/__tests__/useMediaRecorder.test.js @@ -1,5 +1,5 @@ import { TranslationProvider } from '../../../../context'; -import { renderHook } from '@testing-library/react-hooks'; +import { renderHook } from '@testing-library/react'; import React from 'react'; import { useMediaRecorder } from '../useMediaRecorder'; import { EventEmitterMock } from '../../../../mock-builders/browser'; diff --git a/src/components/Message/__tests__/FixedHeightMessage.test.js b/src/components/Message/__tests__/FixedHeightMessage.test.js index f45f3d360..27940b25d 100644 --- a/src/components/Message/__tests__/FixedHeightMessage.test.js +++ b/src/components/Message/__tests__/FixedHeightMessage.test.js @@ -83,13 +83,13 @@ describe('', () => { const attachments = [image, image, image]; const message = generateMessage({ attachments, user: alice }); await renderMsg(message); - expect(GalleryMock).toHaveBeenCalledWith({ images: attachments }, {}); + expect(GalleryMock).toHaveBeenCalledWith({ images: attachments }, undefined); }); it('should render user avatar', async () => { const message = generateMessage({ user: alice }); await renderMsg(message); - expect(AvatarMock).toHaveBeenCalledWith(expect.objectContaining(aliceProfile), {}); + expect(AvatarMock).toHaveBeenCalledWith(expect.objectContaining(aliceProfile), undefined); }); it('should render MML', async () => { @@ -98,14 +98,17 @@ describe('', () => { await renderMsg(message); expect(MMLMock).toHaveBeenCalledWith( expect.objectContaining({ align: 'left', source: mml }), - {}, + undefined, ); }); it('should render message action for owner', async () => { const message = generateMessage({ user: alice }); await renderMsg(message); - expect(MessageActionsMock).toHaveBeenCalledWith(expect.objectContaining({ message }), {}); + expect(MessageActionsMock).toHaveBeenCalledWith( + expect.objectContaining({ message }), + undefined, + ); expect(MessageActionsMock).toHaveReturnedWith(['delete']); }); diff --git a/src/components/Message/__tests__/MessageSimple.test.js b/src/components/Message/__tests__/MessageSimple.test.js index ab27b69df..2e13fec1e 100644 --- a/src/components/Message/__tests__/MessageSimple.test.js +++ b/src/components/Message/__tests__/MessageSimple.test.js @@ -221,7 +221,7 @@ describe('', () => { Input: CustomEditMessageInput, message, }), - {}, + undefined, ); const results = await axe(container); expect(results).toHaveNoViolations(); @@ -290,7 +290,7 @@ describe('', () => { onClose: clearEditingState, open: true, }), - {}, + undefined, ); expect(MessageInputMock).toHaveBeenCalledWith( expect.objectContaining({ @@ -298,7 +298,7 @@ describe('', () => { Input: EditMessageForm, message, }), - {}, + undefined, ); const results = await axe(container); expect(results).toHaveNoViolations(); @@ -471,7 +471,7 @@ describe('', () => { onMouseOver: expect.any(Function), user: expect.any(Object), }, - {}, + undefined, ); const results = await axe(container); expect(results).toHaveNoViolations(); @@ -512,7 +512,7 @@ describe('', () => { const { container } = await renderMessageSimple({ message }); expect(MMLMock).toHaveBeenCalledWith( expect.objectContaining({ align: 'right', source: mml }), - {}, + undefined, ); const results = await axe(container); expect(results).toHaveNoViolations(); @@ -527,7 +527,7 @@ describe('', () => { }); expect(MMLMock).toHaveBeenCalledWith( expect.objectContaining({ align: 'left', source: mml }), - {}, + undefined, ); const results = await axe(container); expect(results).toHaveNoViolations(); diff --git a/src/components/Message/__tests__/MessageText.test.js b/src/components/Message/__tests__/MessageText.test.js index 4f561c2a9..331ebb505 100644 --- a/src/components/Message/__tests__/MessageText.test.js +++ b/src/components/Message/__tests__/MessageText.test.js @@ -1,9 +1,7 @@ -/* eslint-disable jest-dom/prefer-to-have-class */ import '@testing-library/jest-dom'; import { act, fireEvent, render, screen, waitFor } from '@testing-library/react'; import { toHaveNoViolations } from 'jest-axe'; import React from 'react'; -import testRenderer from 'react-test-renderer'; import { axe } from '../../../../axe-helper'; import { @@ -56,7 +54,6 @@ function generateAliceMessage(messageOptions) { async function renderMessageText({ customProps = {}, channelConfigOverrides = {}, - renderer = render, channelCapabilitiesOverrides = {}, } = {}) { const client = await getTestClientWithUser(alice); @@ -68,7 +65,7 @@ async function renderMessageText({ const channelConfig = channel.getConfig(); const customDateTimeParser = jest.fn(() => ({ format: jest.fn() })); - return renderer( + return render( ', () => { attachments: [attachment, attachment, attachment], }); const { container, getByTestId } = await renderMessageText({ customProps: { message } }); - expect(getByTestId(messageTextTestId).className).toContain('--has-attachment'); + expect(getByTestId(messageTextTestId)).toHaveClass( + 'str-chat__message-simple-text-inner--has-attachment', + ); const results = await axe(container); expect(results).toHaveNoViolations(); }); @@ -139,7 +138,9 @@ describe('', () => { it('should set emoji css class when message has text that is only emojis', async () => { const message = generateAliceMessage({ text: '🤖🤖🤖🤖' }); const { container, getByTestId } = await renderMessageText({ customProps: { message } }); - expect(getByTestId(messageTextTestId).className).toContain('--is-emoji'); + expect(getByTestId(messageTextTestId)).toHaveClass( + 'str-chat__message-simple-text-inner--is-emoji', + ); const results = await axe(container); expect(results).toHaveNoViolations(); }); @@ -290,29 +291,26 @@ describe('', () => { it('should render with a custom wrapper class when one is set', async () => { const customWrapperClass = 'custom-wrapper'; const message = generateMessage({ text: 'hello world' }); - const tree = await renderMessageText({ + const { container } = await renderMessageText({ customProps: { customWrapperClass, message }, - renderer: testRenderer.create, }); - expect(tree.toJSON()).toMatchSnapshot(); + expect(container).toMatchSnapshot(); }); it('should render with a custom inner class when one is set', async () => { const customInnerClass = 'custom-inner'; const message = generateMessage({ text: 'hi mate' }); - const tree = await renderMessageText({ + const { container } = await renderMessageText({ customProps: { customInnerClass, message }, - renderer: testRenderer.create, }); - expect(tree.toJSON()).toMatchSnapshot(); + expect(container).toMatchSnapshot(); }); it('should render with custom theme identifier in generated css classes when theme is set', async () => { const message = generateMessage({ text: 'whatup?!' }); - const tree = await renderMessageText({ + const { container } = await renderMessageText({ customProps: { message, theme: 'custom' }, - renderer: testRenderer.create, }); - expect(tree.toJSON()).toMatchSnapshot(); + expect(container).toMatchSnapshot(); }); }); diff --git a/src/components/Message/__tests__/__snapshots__/MessageText.test.js.snap b/src/components/Message/__tests__/__snapshots__/MessageText.test.js.snap index 9ada82a1b..590c69bfb 100644 --- a/src/components/Message/__tests__/__snapshots__/MessageText.test.js.snap +++ b/src/components/Message/__tests__/__snapshots__/MessageText.test.js.snap @@ -1,187 +1,187 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[` should render with a custom inner class when one is set 1`] = ` -
+
-
-
+
+
-
-

- hi mate -

+
+
+

+ hi mate +

+
-
-
- - - - + + + + +
+ -
`; exports[` should render with a custom wrapper class when one is set 1`] = ` -
+
-
-
+
+
-
-

- hello world -

+
+
+

+ hello world +

+
-
-
- - - - + + + + +
+ -
`; exports[` should render with custom theme identifier in generated css classes when theme is set 1`] = ` -
+
-
-
+
+
-
-

- whatup?! -

+
+
+

+ whatup?! +

+
-
-
- - - - + + + + +
+ -
`; diff --git a/src/components/Message/hooks/__tests__/useActionHandler.test.js b/src/components/Message/hooks/__tests__/useActionHandler.test.js index 77111c631..93d5b21da 100644 --- a/src/components/Message/hooks/__tests__/useActionHandler.test.js +++ b/src/components/Message/hooks/__tests__/useActionHandler.test.js @@ -1,5 +1,5 @@ import React from 'react'; -import { renderHook } from '@testing-library/react-hooks'; +import { renderHook } from '@testing-library/react'; import { handleActionWarning, useActionHandler } from '../useActionHandler'; diff --git a/src/components/Message/hooks/__tests__/useDeleteHandler.test.js b/src/components/Message/hooks/__tests__/useDeleteHandler.test.js index 79af5bcef..3ddd469c7 100644 --- a/src/components/Message/hooks/__tests__/useDeleteHandler.test.js +++ b/src/components/Message/hooks/__tests__/useDeleteHandler.test.js @@ -1,5 +1,5 @@ import React from 'react'; -import { renderHook } from '@testing-library/react-hooks'; +import { renderHook } from '@testing-library/react'; import { useDeleteHandler } from '../useDeleteHandler'; import { diff --git a/src/components/Message/hooks/__tests__/useEditHandler.test.js b/src/components/Message/hooks/__tests__/useEditHandler.test.js index 3d16fbd60..9a60e8414 100644 --- a/src/components/Message/hooks/__tests__/useEditHandler.test.js +++ b/src/components/Message/hooks/__tests__/useEditHandler.test.js @@ -1,4 +1,4 @@ -import { act, renderHook } from '@testing-library/react-hooks'; +import { act, renderHook } from '@testing-library/react'; import { useEditHandler } from '../useEditHandler'; const mouseEventMock = { diff --git a/src/components/Message/hooks/__tests__/useFlagHandler.test.js b/src/components/Message/hooks/__tests__/useFlagHandler.test.js index 7b97b9afa..8e91ff81b 100644 --- a/src/components/Message/hooks/__tests__/useFlagHandler.test.js +++ b/src/components/Message/hooks/__tests__/useFlagHandler.test.js @@ -1,5 +1,5 @@ import React from 'react'; -import { renderHook } from '@testing-library/react-hooks'; +import { renderHook } from '@testing-library/react'; import { missingUseFlagHandlerParameterWarning, useFlagHandler } from '../useFlagHandler'; diff --git a/src/components/Message/hooks/__tests__/useMentionsHandler.test.js b/src/components/Message/hooks/__tests__/useMentionsHandler.test.js index ef5788178..0b6928a1a 100644 --- a/src/components/Message/hooks/__tests__/useMentionsHandler.test.js +++ b/src/components/Message/hooks/__tests__/useMentionsHandler.test.js @@ -1,5 +1,5 @@ import React from 'react'; -import { renderHook } from '@testing-library/react-hooks'; +import { renderHook } from '@testing-library/react'; import { useMentionsHandler } from '../useMentionsHandler'; diff --git a/src/components/Message/hooks/__tests__/useMuteHandler.test.js b/src/components/Message/hooks/__tests__/useMuteHandler.test.js index 61f49e4af..e03de5360 100644 --- a/src/components/Message/hooks/__tests__/useMuteHandler.test.js +++ b/src/components/Message/hooks/__tests__/useMuteHandler.test.js @@ -1,5 +1,5 @@ import React from 'react'; -import { renderHook } from '@testing-library/react-hooks'; +import { renderHook } from '@testing-library/react'; import { missingUseMuteHandlerParamsWarning, useMuteHandler } from '../useMuteHandler'; diff --git a/src/components/Message/hooks/__tests__/useOpenThreadHandler.test.js b/src/components/Message/hooks/__tests__/useOpenThreadHandler.test.js index 94b0ee3ad..84af38d42 100644 --- a/src/components/Message/hooks/__tests__/useOpenThreadHandler.test.js +++ b/src/components/Message/hooks/__tests__/useOpenThreadHandler.test.js @@ -1,5 +1,5 @@ import React from 'react'; -import { renderHook } from '@testing-library/react-hooks'; +import { renderHook } from '@testing-library/react'; import { useOpenThreadHandler } from '../useOpenThreadHandler'; diff --git a/src/components/Message/hooks/__tests__/useReactionHandler.test.js b/src/components/Message/hooks/__tests__/useReactionHandler.test.js index 3b61291ff..8bdf1dcdf 100644 --- a/src/components/Message/hooks/__tests__/useReactionHandler.test.js +++ b/src/components/Message/hooks/__tests__/useReactionHandler.test.js @@ -1,5 +1,5 @@ import React from 'react'; -import { renderHook } from '@testing-library/react-hooks'; +import { renderHook } from '@testing-library/react'; import { reactionHandlerWarning, useReactionHandler } from '../useReactionHandler'; diff --git a/src/components/Message/hooks/__tests__/useReactionsFetcher.js b/src/components/Message/hooks/__tests__/useReactionsFetcher.js index 3fa3376ea..6cffe3e07 100644 --- a/src/components/Message/hooks/__tests__/useReactionsFetcher.js +++ b/src/components/Message/hooks/__tests__/useReactionsFetcher.js @@ -1,4 +1,4 @@ -import { renderHook } from '@testing-library/react-hooks'; +import { renderHook } from '@testing-library/react'; import React from 'react'; import { ChannelStateProvider } from '../../../../context/ChannelStateContext'; diff --git a/src/components/Message/hooks/__tests__/useRetryHandler.test.js b/src/components/Message/hooks/__tests__/useRetryHandler.test.js index e9d9bc2db..f3b03cf83 100644 --- a/src/components/Message/hooks/__tests__/useRetryHandler.test.js +++ b/src/components/Message/hooks/__tests__/useRetryHandler.test.js @@ -1,5 +1,5 @@ import React from 'react'; -import { renderHook } from '@testing-library/react-hooks'; +import { renderHook } from '@testing-library/react'; import { useRetryHandler } from '../useRetryHandler'; diff --git a/src/components/Message/hooks/__tests__/useUserHandler.test.js b/src/components/Message/hooks/__tests__/useUserHandler.test.js index b3d470a2e..1100fc33d 100644 --- a/src/components/Message/hooks/__tests__/useUserHandler.test.js +++ b/src/components/Message/hooks/__tests__/useUserHandler.test.js @@ -1,4 +1,4 @@ -import { renderHook } from '@testing-library/react-hooks'; +import { renderHook } from '@testing-library/react'; import { generateMessage, generateUser } from 'mock-builders'; import { useUserHandler } from '../useUserHandler'; diff --git a/src/components/Message/hooks/__tests__/useUserRole.test.js b/src/components/Message/hooks/__tests__/useUserRole.test.js index 3c1afed94..7d2aebc02 100644 --- a/src/components/Message/hooks/__tests__/useUserRole.test.js +++ b/src/components/Message/hooks/__tests__/useUserRole.test.js @@ -1,5 +1,5 @@ import React from 'react'; -import { renderHook } from '@testing-library/react-hooks'; +import { renderHook } from '@testing-library/react'; import { useUserRole } from '../useUserRole'; diff --git a/src/components/Message/hooks/__tests__/userMarkUnreadHandler.test.js b/src/components/Message/hooks/__tests__/userMarkUnreadHandler.test.js index b898b6d7b..64c128896 100644 --- a/src/components/Message/hooks/__tests__/userMarkUnreadHandler.test.js +++ b/src/components/Message/hooks/__tests__/userMarkUnreadHandler.test.js @@ -1,5 +1,5 @@ import React from 'react'; -import { renderHook } from '@testing-library/react-hooks'; +import { renderHook } from '@testing-library/react'; import { useMarkUnreadHandler } from '../useMarkUnreadHandler'; import { ChannelStateProvider, TranslationProvider } from '../../../../context'; import { generateMessage } from '../../../../mock-builders'; diff --git a/src/components/Message/renderText/__tests__/__snapshots__/renderText.test.js.snap b/src/components/Message/renderText/__tests__/__snapshots__/renderText.test.js.snap index 3110d8497..afbddb79c 100644 --- a/src/components/Message/renderText/__tests__/__snapshots__/renderText.test.js.snap +++ b/src/components/Message/renderText/__tests__/__snapshots__/renderText.test.js.snap @@ -1,20 +1,22 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`htmlToTextPlugin absent does not keep HTML in text 1`] = `null`; +exports[`htmlToTextPlugin absent does not keep HTML in text 1`] = `
`; exports[`htmlToTextPlugin present keeps HTML in text 1`] = ` -"
- -
" +
+ <div> +<script>console.error('This error should not be logged from renderText.test.js!')</script> +</div> +
`; exports[`keepLineBreaksPlugin absent does not keep line breaks around a blockquote 1`] = ` -[ +

a -

, - " -", +

+ +
@@ -23,515 +25,465 @@ exports[`keepLineBreaksPlugin absent does not keep line breaks around a blockquo

-
, - " -", + + +

c -

, -] +

+
`; exports[`keepLineBreaksPlugin absent does not keep line breaks around a code block 1`] = ` -[ +

a -

, - " -", +

+ +

b -

, - " -", +

+ +

c -

, -] +

+
`; exports[`keepLineBreaksPlugin absent does not keep line breaks around a horizontal rule 1`] = ` -[ +

a -

, - " -", - " -", +

+ + + +

b -

, -] +

+
`; exports[`keepLineBreaksPlugin absent does not keep line breaks around a strikethrough 1`] = ` -[ +

a -

, - " -", +

+ +

~~xxx~~ -

, - " -", +

+ +

b -

, -] +

+
`; exports[`keepLineBreaksPlugin absent does not keep line breaks around a table 1`] = ` -[ +

a -

, - " -", +

+ +

| a | b | c | d | | - | :- | -: | :-: | | a | b | c | d | -

, - " -", +

+ +

c -

, -] +

+
`; exports[`keepLineBreaksPlugin absent does not keep line breaks between paragraphs 1`] = ` -[ +

a -

, - " -", +

+ +

b -

, - " -", +

+ +

c -

, -] +

+
`; exports[`keepLineBreaksPlugin absent does not keep line breaks between the items in an ordered list 1`] = ` -
    - - -
  1. +
    +
      -

      - item 1 -

      - +
    1. + -
    2. - +

      + item 1 +

      + -
    3. +
    4. -

      - item 2 -

      - +
    5. + -
    6. - +

      + item 2 +

      + -
    7. +
    8. -

      - item 3 -

      - +
    9. + -
    10. - +

      + item 3 +

      + + + + -
    +
+
`; exports[`keepLineBreaksPlugin absent does not keep line breaks between the items in an unordered list 1`] = ` -
    - - -
  • +
    +
      -

      - item 1 -

      - +
    • + -
    • - +

      + item 1 +

      + -
    • +
    • -

      - item 2 -

      - +
    • + -
    • - +

      + item 2 +

      + -
    • +
    • -

      - item 3 -

      - +
    • + -
    • - +

      + item 3 +

      + + + + -
    +
+
`; exports[`keepLineBreaksPlugin absent does not keep line breaks under a heading 1`] = ` -[ - "Heading", - " -", +
+ Heading + +

a -

, -] +

+
`; exports[`keepLineBreaksPlugin present keeps line between lines with strong text 1`] = ` -[ +

This is the first line -

, - " -", -
, - " -", - " -", - " -", +

+ + +
+ + + + + +

This is the second line -

, -] +

+
`; exports[`keepLineBreaksPlugin present keeps line breaks around a blockquote 1`] = ` -[ +

a -

, - " -", -
, - " -", - " -", - " -", -
, - " -", - " -", - " -", +

+ + +
+ + + + + + +
+ + + + + +

b

-
, - " -", -
, - " -", - " -", - " -", -
, - " -", - " -", - " -", + + + +
+ + + + + + +
+ + + + + +

c -

, -] +

+
`; exports[`keepLineBreaksPlugin present keeps line breaks around a code block 1`] = ` -[ +

a -

, - " -", -
, - " -", - " -", - " -", -
, - " -", - " -", - " -", +

+ + +
+ + + + + + +
+ + + + + +

b -

, - " -", -
, - " -", - " -", - " -", -
, - " -", - " -", - " -", +

+ + +
+ + + + + + +
+ + + + + +

c -

, -] +

+
`; exports[`keepLineBreaksPlugin present keeps line breaks around a horizontal rule 1`] = ` -[ +

a -

, - " -", -
, - " -", - " -", - " -", -
, - " -", - " -", - " -", - " -", -
, - " -", - " -", - " -", -
, - " -", - " -", - " -", +

+ + +
+ + + + + + +
+ + + + + + + + +
+ + + + + + +
+ + + + + +

b -

, -] +

+
`; exports[`keepLineBreaksPlugin present keeps line breaks around a strikethrough 1`] = ` -[ +

a -

, - " -", -
, - " -", - " -", - " -", -
, - " -", - " -", - " -", +

+ + +
+ + + + + + +
+ + + + + +

~~xxx~~ -

, - " -", -
, - " -", - " -", - " -", -
, - " -", - " -", - " -", +

+ + +
+ + + + + + +
+ + + + + +

b -

, -] +

+
`; exports[`keepLineBreaksPlugin present keeps line breaks around a table 1`] = ` -[ +

a -

, - " -", -
, - " -", - " -", - " -", -
, - " -", - " -", - " -", +

+ + +
+ + + + + + +
+ + + + + +

| a | b | c | d | | - | :- | -: | :-: | | a | b | c | d | -

, - " -", -
, - " -", - " -", - " -", -
, - " -", - " -", - " -", +

+ + +
+ + + + + + +
+ + + + + +

c -

, -] +

+
`; exports[`keepLineBreaksPlugin present keeps line breaks between paragraphs 1`] = ` -[ +

a -

, - " -", -
, - " -", - " -", - " -", -
, - " -", - " -", - " -", -

- b -

, - " -", -
, - " -", - " -", - " -", -
, - " -", - " -", - " -", -

- c -

, -] -`; - -exports[`keepLineBreaksPlugin present keeps line breaks between the items in an ordered list 1`] = ` -
    - - -
  1. - - -

    - item 1 -

    - - -
  2. +


    @@ -548,13 +500,9 @@ exports[`keepLineBreaksPlugin present keeps line breaks between the items in an -
  3. -

    - item 2 -

    - - -
  4. +

    + b +


    @@ -571,61 +519,147 @@ exports[`keepLineBreaksPlugin present keeps line breaks between the items in an -
  5. -

    - item 3 -

    +

    + c +

    +
+`; + +exports[`keepLineBreaksPlugin present keeps line breaks between the items in an ordered list 1`] = ` +
+
    - - +
  1. + + +

    + item 1 +

    + + +
  2. + + +
    + -
+ + + + +
+ + + + + + +
  • +

    + item 2 +

    + + +
  • + + +
    + + + + + + +
    + + + + + + +
  • +

    + item 3 +

    + + +
  • + + + +
    `; exports[`keepLineBreaksPlugin present keeps line breaks between the items in an unordered list 1`] = ` -
      - +
      +
        + -
      • +
      • + + +

        + item 1 +

        + + +
      • -

        - item 1 -

        +
        - - + -
        - + - +
        + - + -
        - + - +
      • +

        + item 2 +

        + - +
      • + -
      • -

        - item 2 -

        +
        -
      • - + -
        - + - +
        + + + + + +
      • +

        + item 3 +

        + + +
      • + + +
      +
      +`; + +exports[`keepLineBreaksPlugin present keeps line breaks under a heading 1`] = ` +
      + Heading
      @@ -635,244 +669,238 @@ exports[`keepLineBreaksPlugin present keeps line breaks between the items in an -
    • -

      - item 3 -

      - +
      + -
    • -
    -`; + -exports[`keepLineBreaksPlugin present keeps line breaks under a heading 1`] = ` -[ - "Heading", - " -", -
    , - " -", - " -", - " -", -
    , - " -", - " -", - " -",

    a -

    , -] +

    +
    `; exports[`renderText handles the special case where there are pronouns in the name 1`] = ` -

    - hey, - - @John (they/them) - - , how are you? -

    +
    +

    + hey, + + @John (they/them) + + , how are you? +

    +
    `; exports[`renderText handles the special case where there is a backslash in the name 1`] = ` -

    - hey, - - @John\\Cena - - , how are you? -

    +
    +

    + hey, + + @John\\Cena + + , how are you? +

    +
    `; exports[`renderText handles the special case where there is a forward slash in the name 1`] = ` -

    - hey, - - @John/Cena - - , how are you? -

    +
    +

    + hey, + + @John/Cena + + , how are you? +

    +
    `; exports[`renderText handles the special case where there's at least one mention and @ symbol at the end 1`] = ` -

    - - @username@email.com - - @ -

    +
    +

    + + @username@email.com + + @ +

    +
    `; exports[`renderText handles the special case where user name matches to an e-mail pattern - 1 1`] = ` -

    - Hello - - @username@email.com - - , is - - username@email.com - - your @primary e-mail? -

    +
    +

    + Hello + + @username@email.com + + , is + + username@email.com + + your @primary e-mail? +

    +
    `; exports[`renderText handles the special case where user name matches to an e-mail pattern - 2 1`] = ` -

    - - username@email.com - - - - @username@email.com - - is this the right address? -

    +
    +

    + + username@email.com + + + + @username@email.com + + is this the right address? +

    +
    `; exports[`renderText handles the special case where user name matches to an e-mail pattern - 3 1`] = ` -

    - - @username@email.com - - - - @username@email.com - - - - @username@email.com - - - - @username@email.com - -

    +
    +

    + + @username@email.com + + + + @username@email.com + + + + @username@email.com + + + + @username@email.com + +

    +
    `; exports[`renderText handles the special case where user name matches to an e-mail pattern - 4 1`] = ` -

    - - @username@email.com - - - - @username@email.com - - - - username@email.com - - - - @username@email.com - -

    +
    +

    + + @username@email.com + + + + @username@email.com + + + + username@email.com + + + + @username@email.com + +

    +
    `; exports[`renderText renders custom mention 1`] = ` -

    - - @username@email.com - - - - @username@email.com - - - - username@email.com - - - - @username@email.com - -

    +
    +

    + + @username@email.com + + + + @username@email.com + + + + username@email.com + + + + @username@email.com + +

    +
    `; exports[`renderText renders remark-gfm list and strikethrough correctly 1`] = ` -[ +

    Pick a time to meet: -

    , - " -", +

    + +
      @@ -898,16 +926,18 @@ exports[`renderText renders remark-gfm list and strikethrough correctly 1`] = ` -
    , -] + +
    `; exports[`renderText renders standard markdown text 1`] = ` -

    - Hi, shall we meet on - - Tuesday - - ? -

    +
    +

    + Hi, shall we meet on + + Tuesday + + ? +

    +
    `; diff --git a/src/components/Message/renderText/__tests__/renderText.test.js b/src/components/Message/renderText/__tests__/renderText.test.js index 38433282b..15be065a7 100644 --- a/src/components/Message/renderText/__tests__/renderText.test.js +++ b/src/components/Message/renderText/__tests__/renderText.test.js @@ -1,7 +1,7 @@ import React from 'react'; -import renderer from 'react-test-renderer'; import { findAndReplace } from 'hast-util-find-and-replace'; import { u } from 'unist-builder'; +import { render } from '@testing-library/react'; import { htmlToTextPlugin, keepLineBreaksPlugin } from '../remarkPlugins'; import { defaultAllowedTagNames, renderText } from '../renderText'; @@ -13,8 +13,8 @@ describe(`renderText`, () => { 'Hello @username@email.com, is username@email.com your @primary e-mail?', [{ id: 'id-username@email.com', name: 'username@email.com' }], ); - const tree = renderer.create(Markdown).toJSON(); - expect(tree).toMatchSnapshot(); + const { container } = render(Markdown); + expect(container).toMatchSnapshot(); }); it('handles the special case where user name matches to an e-mail pattern - 2', () => { @@ -22,8 +22,8 @@ describe(`renderText`, () => { 'username@email.com @username@email.com is this the right address?', [{ id: 'id-username@email.com', name: 'username@email.com' }], ); - const tree = renderer.create(Markdown).toJSON(); - expect(tree).toMatchSnapshot(); + const { container } = render(Markdown); + expect(container).toMatchSnapshot(); }); it('handles the special case where user name matches to an e-mail pattern - 3', () => { @@ -31,8 +31,8 @@ describe(`renderText`, () => { '@username@email.com @username@email.com @username@email.com @username@email.com', [{ id: 'id-username@email.com', name: 'username@email.com' }], ); - const tree = renderer.create(Markdown).toJSON(); - expect(tree).toMatchSnapshot(); + const { container } = render(Markdown); + expect(container).toMatchSnapshot(); }); it('handles the special case where user name matches to an e-mail pattern - 4', () => { @@ -40,13 +40,13 @@ describe(`renderText`, () => { '@username@email.com @username@email.com username@email.com @username@email.com', [{ id: 'id-username@email.com', name: 'username@email.com' }], ); - const tree = renderer.create(Markdown).toJSON(); - expect(tree).toMatchSnapshot(); + const { container } = render(Markdown); + expect(container).toMatchSnapshot(); }); it('renders custom mention', () => { const CustomMention = (props) => ( - + {props.children} ); @@ -59,14 +59,14 @@ describe(`renderText`, () => { }, }, ); - const tree = renderer.create(Markdown).toJSON(); - expect(tree).toMatchSnapshot(); + const { container } = render(Markdown); + expect(container).toMatchSnapshot(); }); it('renders standard markdown text', () => { const Markdown = renderText('Hi, shall we meet on **Tuesday**?', []); - const tree = renderer.create(Markdown).toJSON(); - expect(tree).toMatchSnapshot(); + const { container } = render(Markdown); + expect(container).toMatchSnapshot(); }); it('renders remark-gfm list and strikethrough correctly', () => { @@ -74,56 +74,58 @@ describe(`renderText`, () => { 'Pick a time to meet:\n- Wednesday\n- Thursday\n- ~~Sunday~~\n- ~Monday~\n', [], ); - const tree = renderer.create(Markdown).toJSON(); - expect(tree).toMatchSnapshot(); + const { container } = render(Markdown); + expect(container).toMatchSnapshot(); }); it("handles the special case where there's at least one mention and @ symbol at the end", () => { const Markdown = renderText('@username@email.com @', [ { id: 'id-username@email.com', name: 'username@email.com' }, ]); - const tree = renderer.create(Markdown).toJSON(); - expect(tree).toMatchSnapshot(); + const { container } = render(Markdown); + expect(container).toMatchSnapshot(); }); it('handles the special case where there are pronouns in the name', () => { const Markdown = renderText('hey, @John (they/them), how are you?', [ { id: 'john', name: 'John (they/them)' }, ]); - const tree = renderer.create(Markdown).toJSON(); - expect(tree).toMatchSnapshot(); + const { container } = render(Markdown); + expect(container).toMatchSnapshot(); }); it('handles the special case where there is a forward slash in the name', () => { const Markdown = renderText('hey, @John/Cena, how are you?', [ { id: 'john', name: 'John/Cena' }, ]); - const tree = renderer.create(Markdown).toJSON(); - expect(tree).toMatchSnapshot(); + const { container } = render(Markdown); + expect(container).toMatchSnapshot(); }); it('handles the special case where there is a backslash in the name', () => { const Markdown = renderText('hey, @John\\Cena, how are you?', [ { id: 'john', name: 'John\\Cena' }, ]); - const tree = renderer.create(Markdown).toJSON(); - expect(tree).toMatchSnapshot(); + const { container } = render(Markdown); + expect(container).toMatchSnapshot(); }); it('parses user mention to default format', () => { const Markdown = renderText('@username@email.com', [ { id: 'id-username@email.com', name: 'username@email.com' }, ]); - const tree = renderer.create(Markdown).toJSON(); - expect(tree).toMatchInlineSnapshot(` -

    - - @username@email.com - -

    + const { container } = render(Markdown); + expect(container).toMatchInlineSnapshot(` +
    +

    + + @username@email.com + +

    +
    `); }); @@ -135,19 +137,21 @@ describe(`renderText`, () => { [{ id: 'id-username@email.com', name: 'username@email.com' }], { getRehypePlugins }, ); - const tree = renderer.create(Markdown).toJSON(); - expect(tree).toMatchInlineSnapshot(` -

    - @ - - username@email.com - -

    + const { container } = render(Markdown); + expect(container).toMatchInlineSnapshot(` + `); }); @@ -159,19 +163,21 @@ describe(`renderText`, () => { [{ id: 'id-username@email.com', name: 'username@email.com' }], { getRehypePlugins }, ); - const tree = renderer.create(Markdown).toJSON(); - expect(tree).toMatchInlineSnapshot(` -

    - # - + const { container } = render(Markdown); + expect(container).toMatchInlineSnapshot(` +

    `); }); @@ -183,28 +189,32 @@ describe(`renderText`, () => { [{ id: 'id-username@email.com', name: 'username@email.com' }], { getRehypePlugins }, ); - const tree = renderer.create(Markdown).toJSON(); - expect(tree).toMatchInlineSnapshot(` -

    - - # - -

    + const { container } = render(Markdown); + expect(container).toMatchInlineSnapshot(` +
    +

    + + # + +

    +
    `); }); it('renders strikethrough', () => { const Markdown = renderText(strikeThroughText); - const tree = renderer.create(Markdown).toJSON(); - expect(tree).toMatchInlineSnapshot(` -

    - - xxx - -

    + const { container } = render(Markdown); + expect(container).toMatchInlineSnapshot(` +
    +

    + + xxx + +

    +
    `); }); @@ -212,11 +222,13 @@ describe(`renderText`, () => { const customPlugin = () => (tree) => tree; const getRemarkPlugins = () => [customPlugin]; const Markdown = renderText(strikeThroughText, [], { getRemarkPlugins }); - const tree = renderer.create(Markdown).toJSON(); - expect(tree).toMatchInlineSnapshot(` -

    - ~~xxx~~ -

    + const { container } = render(Markdown); + expect(container).toMatchInlineSnapshot(` +
    +

    + ~~xxx~~ +

    +
    `); }); @@ -231,14 +243,8 @@ describe(`renderText`, () => { const Markdown = renderText(strikeThroughText, [], { getRemarkPlugins, }); - const tree = renderer.create(Markdown).toJSON(); - expect(tree).toMatchInlineSnapshot(` -

    - - xxx - -

    - `); + const { container } = render(Markdown); + expect(container.innerHTML).toBe('

    xxx

    '); }); }); @@ -253,15 +259,17 @@ describe(`renderText`, () => { allowedTagNames: [...defaultAllowedTagNames, customTagName], getRehypePlugins, }); - const tree = renderer.create(Markdown).toJSON(); - expect(tree).toMatchInlineSnapshot(` -

    - a - - b - - c -

    + const { container } = render(Markdown); + expect(container).toMatchInlineSnapshot(` +
    +

    + a + + b + + c +

    +
    `); }); }); @@ -285,90 +293,90 @@ describe('keepLineBreaksPlugin', () => { {}, { getRemarkPlugins: () => (present ? [keepLineBreaksPlugin] : []) }, ); - return renderer.create(Markdown).toJSON(); + return render(Markdown).container; }; describe('absent', () => { const present = false; it(`does not keep line breaks between paragraphs`, () => { - const tree = doRenderText(paragraphText, present); - expect(tree).toMatchSnapshot(); + const container = doRenderText(paragraphText, present); + expect(container).toMatchSnapshot(); }); it(`does not keep line breaks between the items in an unordered list`, () => { - const tree = doRenderText(unorderedListText, present); - expect(tree).toMatchSnapshot(); + const container = doRenderText(unorderedListText, present); + expect(container).toMatchSnapshot(); }); it(`does not keep line breaks between the items in an ordered list`, () => { - const tree = doRenderText(orderedListText, present); - expect(tree).toMatchSnapshot(); + const container = doRenderText(orderedListText, present); + expect(container).toMatchSnapshot(); }); it(`does not keep line breaks under a heading`, () => { - const tree = doRenderText(headingText, present); - expect(tree).toMatchSnapshot(); + const container = doRenderText(headingText, present); + expect(container).toMatchSnapshot(); }); it(`does not keep line breaks around a horizontal rule`, () => { - const tree = doRenderText(horizontalRuleText, present); - expect(tree).toMatchSnapshot(); + const container = doRenderText(horizontalRuleText, present); + expect(container).toMatchSnapshot(); }); it(`does not keep line breaks around a code block`, () => { - const tree = doRenderText(codeBlockText, present); - expect(tree).toMatchSnapshot(); + const container = doRenderText(codeBlockText, present); + expect(container).toMatchSnapshot(); }); it(`does not keep line breaks around a blockquote`, () => { - const tree = doRenderText(blockquoteText, present); - expect(tree).toMatchSnapshot(); + const container = doRenderText(blockquoteText, present); + expect(container).toMatchSnapshot(); }); it(`does not keep line breaks around a strikethrough`, () => { - const tree = doRenderText(withStrikeThroughText, present); - expect(tree).toMatchSnapshot(); + const container = doRenderText(withStrikeThroughText, present); + expect(container).toMatchSnapshot(); }); it(`does not keep line breaks around a table`, () => { - const tree = doRenderText(tableText, present); - expect(tree).toMatchSnapshot(); + const container = doRenderText(tableText, present); + expect(container).toMatchSnapshot(); }); }); describe('present', () => { const present = true; it(`keeps line breaks between paragraphs`, () => { - const tree = doRenderText(paragraphText, present); - expect(tree).toMatchSnapshot(); + const container = doRenderText(paragraphText, present); + expect(container).toMatchSnapshot(); }); it(`keeps line breaks between the items in an unordered list`, () => { - const tree = doRenderText(unorderedListText, present); - expect(tree).toMatchSnapshot(); + const container = doRenderText(unorderedListText, present); + expect(container).toMatchSnapshot(); }); it(`keeps line breaks between the items in an ordered list`, () => { - const tree = doRenderText(orderedListText, present); - expect(tree).toMatchSnapshot(); + const container = doRenderText(orderedListText, present); + expect(container).toMatchSnapshot(); }); it(`keeps line breaks under a heading`, () => { - const tree = doRenderText(headingText, present); - expect(tree).toMatchSnapshot(); + const container = doRenderText(headingText, present); + expect(container).toMatchSnapshot(); }); it(`keeps line breaks around a horizontal rule`, () => { - const tree = doRenderText(horizontalRuleText, present); - expect(tree).toMatchSnapshot(); + const container = doRenderText(horizontalRuleText, present); + expect(container).toMatchSnapshot(); }); it(`keeps line breaks around a code block`, () => { - const tree = doRenderText(codeBlockText, present); - expect(tree).toMatchSnapshot(); + const container = doRenderText(codeBlockText, present); + expect(container).toMatchSnapshot(); }); it(`keeps line breaks around a blockquote`, () => { - const tree = doRenderText(blockquoteText, present); - expect(tree).toMatchSnapshot(); + const container = doRenderText(blockquoteText, present); + expect(container).toMatchSnapshot(); }); it(`keeps line breaks around a strikethrough`, () => { - const tree = doRenderText(withStrikeThroughText, present); - expect(tree).toMatchSnapshot(); + const container = doRenderText(withStrikeThroughText, present); + expect(container).toMatchSnapshot(); }); it(`keeps line breaks around a table`, () => { - const tree = doRenderText(tableText, present); - expect(tree).toMatchSnapshot(); + const container = doRenderText(tableText, present); + expect(container).toMatchSnapshot(); }); it(`keeps line between lines with strong text`, () => { - const tree = doRenderText(multilineWithStrongText, present); - expect(tree).toMatchSnapshot(); + const container = doRenderText(multilineWithStrongText, present); + expect(container).toMatchSnapshot(); }); }); }); @@ -385,16 +393,16 @@ describe('htmlToTextPlugin', () => { {}, { getRemarkPlugins: () => (withPlugin ? [htmlToTextPlugin] : []) }, ); - return renderer.create(Markdown).toJSON(); + return render(Markdown).container; }; it(`absent does not keep HTML in text`, () => { - const tree = renderTextWithHtml(false); - expect(tree).toMatchSnapshot(); + const container = renderTextWithHtml(false); + expect(container).toMatchSnapshot(); }); it(`present keeps HTML in text`, () => { - const tree = renderTextWithHtml(true); - expect(tree).toMatchSnapshot(); + const container = renderTextWithHtml(true); + expect(container).toMatchSnapshot(); }); }); diff --git a/src/components/MessageActions/MessageActions.tsx b/src/components/MessageActions/MessageActions.tsx index b6ccbc6b5..ecb4a1ad5 100644 --- a/src/components/MessageActions/MessageActions.tsx +++ b/src/components/MessageActions/MessageActions.tsx @@ -1,5 +1,5 @@ import clsx from 'clsx'; -import React, { ElementRef, PropsWithChildren, useCallback, useRef } from 'react'; +import React, { PropsWithChildren, useCallback, useRef } from 'react'; import { MessageActionsBox } from './MessageActionsBox'; @@ -98,7 +98,7 @@ export const MessageActions = < messageActions, }); - const actionsBoxButtonRef = useRef>(null); + const actionsBoxButtonRef = useRef(null); if (!renderMessageActions) return null; diff --git a/src/components/MessageActions/__tests__/CustomMessageActionsList.test.js b/src/components/MessageActions/__tests__/CustomMessageActionsList.test.js index 9d59d892a..36842c97a 100644 --- a/src/components/MessageActions/__tests__/CustomMessageActionsList.test.js +++ b/src/components/MessageActions/__tests__/CustomMessageActionsList.test.js @@ -1,6 +1,5 @@ import React from 'react'; import { fireEvent, render } from '@testing-library/react'; -import renderer from 'react-test-renderer'; import { CustomMessageActionsList } from '../CustomMessageActionsList'; import { act } from 'react'; @@ -13,29 +12,27 @@ describe('CustomMessageActionsList', () => { key1: () => {}, }; - const tree = renderer.create( + const { container } = render( , ); - expect(tree.toJSON()).toMatchInlineSnapshot(` - [ + expect(container).toMatchInlineSnapshot(` +
    , + , - ] + +
    `); }); diff --git a/src/components/MessageActions/__tests__/MessageActions.test.js b/src/components/MessageActions/__tests__/MessageActions.test.js index 1e03d80b3..536313d2d 100644 --- a/src/components/MessageActions/__tests__/MessageActions.test.js +++ b/src/components/MessageActions/__tests__/MessageActions.test.js @@ -1,6 +1,5 @@ import React from 'react'; import '@testing-library/jest-dom'; -import testRenderer from 'react-test-renderer'; import { act, cleanup, fireEvent, render, screen } from '@testing-library/react'; import { MessageActions } from '../MessageActions'; @@ -46,8 +45,8 @@ const messageContextValue = { const chatClient = getTestClient(); -function renderMessageActions(customProps = {}, renderer = render) { - return renderer( +function renderMessageActions(customProps = {}) { + return render( @@ -77,23 +76,22 @@ describe(' component', () => { beforeEach(jest.clearAllMocks); it('should render correctly when not open', () => { - const tree = renderMessageActions({}, testRenderer.create); - expect(tree.toJSON()).toMatchInlineSnapshot(` - [ + const { container } = renderMessageActions(); + expect(container).toMatchInlineSnapshot(` +
    -
    , +
    , - ] + style="--str-chat__dialog-overlay-height: 0;" + /> +
    `); }); @@ -137,7 +130,7 @@ describe(' component', () => { await toggleOpenMessageActions(); expect(MessageActionsBoxMock).toHaveBeenLastCalledWith( expect.objectContaining({ open: true }), - {}, + undefined, ); expect(dialogOverlay.children.length).toBeGreaterThan(0); }); @@ -149,7 +142,7 @@ describe(' component', () => { await toggleOpenMessageActions(); expect(MessageActionsBoxMock).toHaveBeenLastCalledWith( expect.objectContaining({ open: true }), - {}, + undefined, ); await toggleOpenMessageActions(); expect(dialogOverlay.children).toHaveLength(0); @@ -160,7 +153,7 @@ describe(' component', () => { await toggleOpenMessageActions(); expect(MessageActionsBoxMock).toHaveBeenLastCalledWith( expect.objectContaining({ open: true }), - {}, + undefined, ); const dialogOverlay = screen.getByTestId(dialogOverlayTestId); await act(async () => { @@ -196,7 +189,7 @@ describe(' component', () => { mine: false, open: true, }), - {}, + undefined, ); }); @@ -220,28 +213,24 @@ describe(' component', () => { }); it('should render with a custom wrapper class when one is set', () => { - const tree = renderMessageActions( - { - customWrapperClass: 'custom-wrapper-class', - }, - testRenderer.create, - ); - expect(tree.toJSON()).toMatchInlineSnapshot(` - [ + const { container } = renderMessageActions({ + customWrapperClass: 'custom-wrapper-class', + }); + expect(container).toMatchInlineSnapshot(` +
    -
    , +
    , - ] + style="--str-chat__dialog-overlay-height: 0;" + /> +
    `); }); it('should render with an inline element wrapper when inline set', () => { - const tree = renderMessageActions( - { - inline: true, - }, - testRenderer.create, - ); - expect(tree.toJSON()).toMatchInlineSnapshot(` - [ + const { container } = renderMessageActions({ + inline: true, + }); + expect(container).toMatchInlineSnapshot(` +
    - , +
    , - ] + style="--str-chat__dialog-overlay-height: 0;" + /> +
    `); }); }); diff --git a/src/components/MessageActions/__tests__/MessageActionsBox.test.js b/src/components/MessageActions/__tests__/MessageActionsBox.test.js index 6a62a5383..499c91eb7 100644 --- a/src/components/MessageActions/__tests__/MessageActionsBox.test.js +++ b/src/components/MessageActions/__tests__/MessageActionsBox.test.js @@ -435,8 +435,8 @@ describe('MessageActionsBox', () => { messageProps: { message }, }); await toggleOpenMessageActions(); + await act(async () => { - await fireEvent.click(screen.getByTestId(TOGGLE_ACTIONS_BUTTON_TEST_ID)); await fireEvent.click(screen.getByText(ACTION_TEXT)); }); expect(channel.markUnread).toHaveBeenCalledWith( @@ -462,7 +462,6 @@ describe('MessageActionsBox', () => { }); await toggleOpenMessageActions(); await act(async () => { - await fireEvent.click(screen.getByTestId(TOGGLE_ACTIONS_BUTTON_TEST_ID)); await fireEvent.click(screen.getByText(ACTION_TEXT)); }); expect(getMarkMessageUnreadSuccessNotification).toHaveBeenCalledWith( @@ -488,7 +487,6 @@ describe('MessageActionsBox', () => { }); await toggleOpenMessageActions(); await act(async () => { - await fireEvent.click(screen.getByTestId(TOGGLE_ACTIONS_BUTTON_TEST_ID)); await fireEvent.click(screen.getByText(ACTION_TEXT)); }); expect(getMarkMessageUnreadErrorNotification).toHaveBeenCalledWith( diff --git a/src/components/MessageInput/hooks/__tests__/useCooldownTimer.test.js b/src/components/MessageInput/hooks/__tests__/useCooldownTimer.test.js index 2691c3223..90526a4e9 100644 --- a/src/components/MessageInput/hooks/__tests__/useCooldownTimer.test.js +++ b/src/components/MessageInput/hooks/__tests__/useCooldownTimer.test.js @@ -1,5 +1,5 @@ import React from 'react'; -import { renderHook } from '@testing-library/react-hooks'; +import { renderHook } from '@testing-library/react'; import { useCooldownTimer } from '../useCooldownTimer'; diff --git a/src/components/MessageInput/hooks/__tests__/useMessageInputState.test.js b/src/components/MessageInput/hooks/__tests__/useMessageInputState.test.js index eea7c66a9..da29c86d3 100644 --- a/src/components/MessageInput/hooks/__tests__/useMessageInputState.test.js +++ b/src/components/MessageInput/hooks/__tests__/useMessageInputState.test.js @@ -1,6 +1,6 @@ import React from 'react'; import { act } from '@testing-library/react'; -import { renderHook } from '@testing-library/react-hooks'; +import { renderHook } from '@testing-library/react'; import { useMessageInputState } from '../useMessageInputState'; import { generateAudioAttachment, @@ -315,20 +315,14 @@ describe('useMessageInputState', () => { await act(async () => { await result.current.uploadAttachment(attachment); }); - - expect(result.all).toHaveLength(3); - expect(result.all[0].attachments).toHaveLength(0); - expect(result.all[1].attachments).toHaveLength(1); - expect(result.all[2].attachments).toHaveLength(1); - // cannot test result.all[1].attachments[0].localMetadata.uploadState === 'uploading' - // as the value is getting overridden by the current result - expect(result.all[2].attachments[0].localMetadata.uploadState).toBe('finished'); + expect(result.current.attachments).toHaveLength(1); + expect(result.current.attachments[0].localMetadata.uploadState).toBe('finished'); if (type === 'image') { - expect(result.all[2].attachments[0].image_url).toBe(assetUrl); - expect(result.all[2].attachments[0].localMetadata.previewUri).toBeUndefined(); + expect(result.current.attachments[0].image_url).toBe(assetUrl); + expect(result.current.attachments[0].localMetadata.previewUri).toBeUndefined(); } else { - expect(result.all[2].attachments[0].asset_url).toBe(assetUrl); + expect(result.current.attachments[0].asset_url).toBe(assetUrl); } }); @@ -372,10 +366,7 @@ describe('useMessageInputState', () => { await result.current.uploadAttachment(attachment); }); - expect(result.all).toHaveLength(3); - expect(result.all[0].attachments).toHaveLength(0); - expect(result.all[1].attachments).toHaveLength(1); - expect(result.all[2].attachments).toHaveLength(0); + expect(result.current.attachments).toHaveLength(0); }); const errMsg = 'Went wrong'; diff --git a/src/components/MessageList/__tests__/CustomNotification.test.js b/src/components/MessageList/__tests__/CustomNotification.test.js index a174675ee..04f10c3fd 100644 --- a/src/components/MessageList/__tests__/CustomNotification.test.js +++ b/src/components/MessageList/__tests__/CustomNotification.test.js @@ -1,8 +1,7 @@ -/* eslint-disable jest-dom/prefer-to-have-class */ import React from 'react'; -import renderer from 'react-test-renderer'; + import { cleanup, render } from '@testing-library/react'; -// import '@testing-library/jest-dom'; +import '@testing-library/jest-dom'; import { CustomNotification } from '../CustomNotification'; @@ -10,23 +9,21 @@ afterEach(cleanup); // eslint-disable-line describe('CustomNotification', () => { it('should render nothing if active is false', () => { - const tree = renderer - .create(test) - .toJSON(); - expect(tree).toMatchInlineSnapshot(`null`); + const { container } = render(test); + expect(container).toBeEmptyDOMElement(); }); it('should render children when active', () => { - const tree = renderer - .create(children) - .toJSON(); - expect(tree).toMatchInlineSnapshot(` -
    - children + const { container } = render(children); + expect(container).toMatchInlineSnapshot(` +
    +
    + children +
    `); }); @@ -40,7 +37,7 @@ describe('CustomNotification', () => { , ); - expect(getByTestId('custom-notification').className).toContain(`notification-${type}`); + expect(getByTestId('custom-notification')).toHaveClass(`notification-${type}`); }); it('should add custom class to className', () => { @@ -52,6 +49,6 @@ describe('CustomNotification', () => { , ); - expect(getByTestId('custom-notification').className).toContain(className); + expect(getByTestId('custom-notification')).toHaveClass(className); }); }); diff --git a/src/components/MessageList/__tests__/MessageList.test.js b/src/components/MessageList/__tests__/MessageList.test.js index 8cf6deaa2..722037830 100644 --- a/src/components/MessageList/__tests__/MessageList.test.js +++ b/src/components/MessageList/__tests__/MessageList.test.js @@ -141,7 +141,7 @@ describe('MessageList', () => { await waitFor(() => { expect(EmptyStateIndicatorMock).toHaveBeenCalledWith( expect.objectContaining({ listType: 'message' }), - expect.any(Object), + undefined, ); }); }); diff --git a/src/components/MessageList/__tests__/VirtualizedMessageList.test.js b/src/components/MessageList/__tests__/VirtualizedMessageList.test.js index a928db091..c5269e591 100644 --- a/src/components/MessageList/__tests__/VirtualizedMessageList.test.js +++ b/src/components/MessageList/__tests__/VirtualizedMessageList.test.js @@ -1,6 +1,6 @@ -import React from 'react'; -import { cleanup } from '@testing-library/react'; -import renderer from 'react-test-renderer'; +import React, { act } from 'react'; +import { cleanup, render } from '@testing-library/react'; + import '@testing-library/jest-dom'; import { @@ -75,49 +75,36 @@ describe('VirtualizedMessageList', () => { it('should render the list without any message', async () => { const { channel, client } = await createChannel(true); - let tree; - - function createNodeMock(element) { - if (element.type === 'div') { - return { - addEventListener() {}, - removeEventListener() {}, - }; - } - return null; - } - - await renderer.act(() => { - tree = renderer.create( + let result; + await act(() => { + result = render( , - { - createNodeMock, - }, ); }); - - expect(tree.toJSON()).toMatchSnapshot(); + expect(result.container).toMatchSnapshot(); }); }); describe('usePrependedMessagesCount', () => { const TestCase = ({ messages }) => { const prependCount = usePrependedMessagesCount(messages); - return
    {prependCount}
    ; + return
    ; }; - const expectPrependCount = (count, root) => { - expect(root.findByType('div').props.children).toStrictEqual(count); + const expectPrependCount = (count, container) => { + expect(container.querySelector('#prepend-counter')).toHaveAttribute( + 'data-prepend-count', + count.toString(), + ); }; it('determines 0 prepended messages for empty message list', async () => { - const render = await renderer.create(); - - expectPrependCount(0, render.root); + const { container } = await render(); + expectPrependCount(0, container); }); const messageBatch = (ids, status) => ids.map((id) => ({ id, status })); @@ -130,24 +117,24 @@ describe('usePrependedMessagesCount', () => { const secondMsgBatch = secondBatch(status); const thirdMsgBatch = thirdBatch(status); - const render = await renderer.create(); + const { container, rerender } = await render(); - await renderer.act(async () => { - await render.update(); - expectPrependCount(first, render.root); + await act(async () => { + await rerender(); }); + expectPrependCount(first, container); - await renderer.act(async () => { - await render.update(); - expectPrependCount(second, render.root); + await act(async () => { + await rerender(); }); + expectPrependCount(second, container); - await renderer.act(async () => { - await render.update( + await act(async () => { + await rerender( , ); - expectPrependCount(third, render.root); }); + expectPrependCount(third, container); }; it('calculates the prepended count for messages of status "received"', async () => { diff --git a/src/components/MessageList/__tests__/__snapshots__/VirtualizedMessageList.test.js.snap b/src/components/MessageList/__tests__/__snapshots__/VirtualizedMessageList.test.js.snap index c0f97e788..757a5c293 100644 --- a/src/components/MessageList/__tests__/__snapshots__/VirtualizedMessageList.test.js.snap +++ b/src/components/MessageList/__tests__/__snapshots__/VirtualizedMessageList.test.js.snap @@ -1,88 +1,69 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`VirtualizedMessageList should render the list without any message 1`] = ` -
    +
    -
    - +
    - - -

    - No chats here yet… -

    + + + +

    + No chats here yet… +

    +
    +
    -
    `; diff --git a/src/components/MessageList/hooks/__tests__/useGiphyPreview.test.js b/src/components/MessageList/hooks/__tests__/useGiphyPreview.test.js index ae6931a4b..8f93f48b0 100644 --- a/src/components/MessageList/hooks/__tests__/useGiphyPreview.test.js +++ b/src/components/MessageList/hooks/__tests__/useGiphyPreview.test.js @@ -1,6 +1,6 @@ import React from 'react'; import { act } from '@testing-library/react'; -import { renderHook } from '@testing-library/react-hooks'; +import { renderHook } from '@testing-library/react'; import { dispatchMessageNewEvent, generateMessage, diff --git a/src/components/MessageList/hooks/__tests__/useMarkRead.test.js b/src/components/MessageList/hooks/__tests__/useMarkRead.test.js index 8ed4380d0..c0bd4497f 100644 --- a/src/components/MessageList/hooks/__tests__/useMarkRead.test.js +++ b/src/components/MessageList/hooks/__tests__/useMarkRead.test.js @@ -1,5 +1,5 @@ import React from 'react'; -import { renderHook } from '@testing-library/react-hooks'; +import { renderHook } from '@testing-library/react'; import { useMarkRead } from '../useMarkRead'; import { ChannelActionProvider, ChannelStateProvider, ChatProvider } from '../../../../context'; import { diff --git a/src/components/MessageList/hooks/__tests__/usePrependMessagesCount.test.js b/src/components/MessageList/hooks/__tests__/usePrependMessagesCount.test.js index 1b668226f..461fc6c83 100644 --- a/src/components/MessageList/hooks/__tests__/usePrependMessagesCount.test.js +++ b/src/components/MessageList/hooks/__tests__/usePrependMessagesCount.test.js @@ -1,4 +1,4 @@ -import { renderHook } from '@testing-library/react-hooks'; +import { renderHook } from '@testing-library/react'; import { usePrependedMessagesCount } from '../VirtualizedMessageList'; import { generateMessage } from '../../../../mock-builders'; diff --git a/src/components/MessageList/hooks/__tests__/useUnreadMessagesNotificationVirtualized.test.js b/src/components/MessageList/hooks/__tests__/useUnreadMessagesNotificationVirtualized.test.js index 431996bf7..66d5bf741 100644 --- a/src/components/MessageList/hooks/__tests__/useUnreadMessagesNotificationVirtualized.test.js +++ b/src/components/MessageList/hooks/__tests__/useUnreadMessagesNotificationVirtualized.test.js @@ -1,4 +1,4 @@ -import { renderHook } from '@testing-library/react-hooks'; +import { renderHook } from '@testing-library/react'; import React from 'react'; import { useUnreadMessagesNotificationVirtualized } from '../VirtualizedMessageList'; import { act } from '@testing-library/react'; diff --git a/src/components/Modal/__tests__/Modal.test.js b/src/components/Modal/__tests__/Modal.test.js index 74227161b..b6d692d30 100644 --- a/src/components/Modal/__tests__/Modal.test.js +++ b/src/components/Modal/__tests__/Modal.test.js @@ -1,6 +1,6 @@ import React from 'react'; import { cleanup, fireEvent, render } from '@testing-library/react'; -import renderer from 'react-test-renderer'; + import '@testing-library/jest-dom'; import { Modal } from '../Modal'; @@ -92,7 +92,7 @@ describe('Modal', () => { }); it('should render the expected html', () => { - const tree = renderer.create( {}} open={false} />).toJSON(); - expect(tree).toMatchInlineSnapshot(`null`); + const { container } = render( {}} open={false} />); + expect(container).toBeEmptyDOMElement(); }); }); diff --git a/src/components/Reactions/__tests__/ReactionSelector.test.js b/src/components/Reactions/__tests__/ReactionSelector.test.js index 3b668ea76..5b63fcb20 100644 --- a/src/components/Reactions/__tests__/ReactionSelector.test.js +++ b/src/components/Reactions/__tests__/ReactionSelector.test.js @@ -103,7 +103,7 @@ describe('ReactionSelector', () => { image: alice.image, name: alice.name, }), - {}, + undefined, ); const results = await axe(container); expect(results).toHaveNoViolations(); @@ -143,7 +143,7 @@ describe('ReactionSelector', () => { image: alice.image, name: alice.name, }), - {}, + undefined, ); const avatarEl = getByTestId('avatar'); diff --git a/src/components/Thread/__tests__/Thread.test.js b/src/components/Thread/__tests__/Thread.test.js index 12306a576..2d1210838 100644 --- a/src/components/Thread/__tests__/Thread.test.js +++ b/src/components/Thread/__tests__/Thread.test.js @@ -1,7 +1,6 @@ import '@testing-library/jest-dom'; import { cleanup, fireEvent, render, waitFor } from '@testing-library/react'; import React from 'react'; -import renderer from 'react-test-renderer'; import { ChannelActionProvider, @@ -131,7 +130,7 @@ describe('Thread', () => { threadList: true, ...additionalMessageListProps, }), - {}, + undefined, ); }); @@ -163,7 +162,7 @@ describe('Thread', () => { threadList: true, ...additionalMessageListProps, }), - {}, + undefined, ); }); @@ -185,7 +184,7 @@ describe('Thread', () => { publishTypingEvent: false, ...props.additionalMessageInputProps, }), - {}, + undefined, ); }); @@ -211,7 +210,7 @@ describe('Thread', () => { publishTypingEvent: false, ...props.additionalMessageInputProps, }), - {}, + undefined, ); }); @@ -235,7 +234,7 @@ describe('Thread', () => { publishTypingEvent: false, ...props.additionalMessageInputProps, }), - {}, + undefined, ); }); @@ -254,7 +253,7 @@ describe('Thread', () => { closeThread: channelActionContextMock.closeThread, thread: parentMessage, }), - {}, + undefined, ); }); }); @@ -280,7 +279,7 @@ describe('Thread', () => { expect.objectContaining({ messageActions, }), - expect.anything(), // refOrContext + undefined, ); }); @@ -323,14 +322,12 @@ describe('Thread', () => { const channel = client.channel('messaging', ch.id); await channel.watch(); - const tree = renderer - .create( - - - , - ) - .toJSON(); + const { container } = render( + + + , + ); - expect(tree).toMatchInlineSnapshot(`null`); + expect(container).toBeEmptyDOMElement(); }); }); diff --git a/src/components/Tooltip/__tests__/Tooltip.test.js b/src/components/Tooltip/__tests__/Tooltip.test.js index 1a75b592c..d46aa1bbe 100644 --- a/src/components/Tooltip/__tests__/Tooltip.test.js +++ b/src/components/Tooltip/__tests__/Tooltip.test.js @@ -1,15 +1,17 @@ import React from 'react'; -import renderer from 'react-test-renderer'; import { Tooltip } from '../Tooltip'; +import { render } from '@testing-library/react'; describe('Tooltip', () => { it('should render as expected', () => { - const tree = renderer.create().toJSON(); - expect(tree).toMatchInlineSnapshot(` -
    + const { container } = render(); + expect(container).toMatchInlineSnapshot(` +
    +
    +
    `); }); }); diff --git a/src/components/TypingIndicator/__tests__/TypingIndicator.test.js b/src/components/TypingIndicator/__tests__/TypingIndicator.test.js index 658d135f8..fea784214 100644 --- a/src/components/TypingIndicator/__tests__/TypingIndicator.test.js +++ b/src/components/TypingIndicator/__tests__/TypingIndicator.test.js @@ -1,5 +1,5 @@ import React from 'react'; -import renderer from 'react-test-renderer'; + import { cleanup, render, screen } from '@testing-library/react'; import '@testing-library/jest-dom'; import { toHaveNoViolations } from 'jest-axe'; @@ -44,37 +44,33 @@ describe('TypingIndicator', () => { it('should render null without proper context values', () => { jest.spyOn(console, 'warn').mockImplementationOnce(() => null); - const tree = renderer - .create( - - - - - - - , - ) - .toJSON(); - expect(tree).toMatchInlineSnapshot(`null`); + const { container } = render( + + + + + + + , + ); + expect(container).toBeEmptyDOMElement(); }); it('should render hidden indicator with empty typing', async () => { const client = await getTestClientWithUser(me); - const tree = renderer - .create( - - - - - - - - - , - ) - .toJSON(); - - expect(tree).toMatchInlineSnapshot(`null`); + const { container } = render( + + + + + + + + + , + ); + + expect(container).toBeEmptyDOMElement(); }); it("should not render TypingIndicator when it's just you typing", async () => { @@ -139,21 +135,19 @@ describe('TypingIndicator', () => { const channelConfig = { typing_events: false }; await channel.watch(); - const tree = renderer - .create( - - - - - - - - - , - ) - .toJSON(); - - expect(tree).toMatchInlineSnapshot(`null`); + const { container } = render( + + + + + + + + + , + ); + + expect(container).toBeEmptyDOMElement(); }); describe('TypingIndicator in thread', () => { diff --git a/src/components/UserItem/__tests__/UserItem.test.js b/src/components/UserItem/__tests__/UserItem.test.js index 1e6461f27..50631e8f4 100644 --- a/src/components/UserItem/__tests__/UserItem.test.js +++ b/src/components/UserItem/__tests__/UserItem.test.js @@ -1,5 +1,5 @@ import React from 'react'; -import renderer from 'react-test-renderer'; + import { cleanup, render } from '@testing-library/react'; import '@testing-library/jest-dom'; import { toHaveNoViolations } from 'jest-axe'; @@ -12,40 +12,40 @@ afterEach(cleanup); // eslint-disable-line describe('UserItem', () => { it('should render component with default props', () => { - const tree = renderer.create().toJSON(); - expect(tree).toMatchInlineSnapshot(` -
    + const { container } = render(); + expect(container).toMatchInlineSnapshot(` +
    - - - -
    - -
    - @ + + + +
    + +
    + @ +
    `); diff --git a/yarn.lock b/yarn.lock index 3bed246a2..e30f461e1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,10 +2,10 @@ # yarn lockfile v1 -"@adobe/css-tools@^4.3.1": - version "4.3.1" - resolved "https://registry.yarnpkg.com/@adobe/css-tools/-/css-tools-4.3.1.tgz#abfccb8ca78075a2b6187345c26243c1a0842f28" - integrity sha512-/62yikz7NLScCGAAST5SHdnjaDJQBDq0M2muyRTpf2VQhw6StBg2ALiu73zSJQ4fMVLA+0uBhBHAle7Wg+2kSg== +"@adobe/css-tools@^4.4.0": + version "4.4.1" + resolved "https://registry.yarnpkg.com/@adobe/css-tools/-/css-tools-4.4.1.tgz#2447a230bfe072c1659e6815129c03cf170710e3" + integrity sha512-12WGKBQzjUAI4ayyF4IAtfw2QR/IDoqk6jTddXDhtYTJF9ASmoE1zst7cVtP0aL/F1jUJL5r+JxKXKEgHNbEUQ== "@ampproject/remapping@^2.2.0": version "2.3.0" @@ -1048,7 +1048,7 @@ core-js-pure "^3.0.0" regenerator-runtime "^0.13.4" -"@babel/runtime@^7.10.2", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.5", "@babel/runtime@^7.15.4", "@babel/runtime@^7.16.3", "@babel/runtime@^7.17.2", "@babel/runtime@^7.17.8", "@babel/runtime@^7.21.0", "@babel/runtime@^7.7.6", "@babel/runtime@^7.8.4", "@babel/runtime@^7.9.2", "@babel/runtime@^7.9.6": +"@babel/runtime@^7.10.2", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.5", "@babel/runtime@^7.15.4", "@babel/runtime@^7.16.3", "@babel/runtime@^7.17.2", "@babel/runtime@^7.17.8", "@babel/runtime@^7.21.0", "@babel/runtime@^7.7.6", "@babel/runtime@^7.8.4", "@babel/runtime@^7.9.6": version "7.24.0" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.24.0.tgz#584c450063ffda59697021430cb47101b085951e" integrity sha512-Chk32uHMg6TnQdvw2e9IlqPpFX/6NLuK0Ys2PqLb7/gL5uFn9mXvK715FGLlOLQrcO4qIkNHkvPGktzzXexsFw== @@ -1503,16 +1503,6 @@ slash "^3.0.0" strip-ansi "^6.0.0" -"@jest/environment@^28.1.3": - version "28.1.3" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-28.1.3.tgz#abed43a6b040a4c24fdcb69eab1f97589b2d663e" - integrity sha512-1bf40cMFTEkKyEf585R9Iz1WayDjHoHqvts0XFYEqyKM3cFWDpeMoqKKTAF9LSYQModPUlh8FKptoM2YcMWAXA== - dependencies: - "@jest/fake-timers" "^28.1.3" - "@jest/types" "^28.1.3" - "@types/node" "*" - jest-mock "^28.1.3" - "@jest/environment@^29.7.0": version "29.7.0" resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-29.7.0.tgz#24d61f54ff1f786f3cd4073b4b94416383baf2a7" @@ -1538,18 +1528,6 @@ expect "^29.7.0" jest-snapshot "^29.7.0" -"@jest/fake-timers@^28.1.3": - version "28.1.3" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-28.1.3.tgz#230255b3ad0a3d4978f1d06f70685baea91c640e" - integrity sha512-D/wOkL2POHv52h+ok5Oj/1gOG9HSywdoPtFsRCUmlCILXNn5eIWmcnd3DIiWlJnpGvQtmajqBP95Ei0EimxfLw== - dependencies: - "@jest/types" "^28.1.3" - "@sinonjs/fake-timers" "^9.1.2" - "@types/node" "*" - jest-message-util "^28.1.3" - jest-mock "^28.1.3" - jest-util "^28.1.3" - "@jest/fake-timers@^29.7.0": version "29.7.0" resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-29.7.0.tgz#fd91bf1fffb16d7d0d24a426ab1a47a49881a565" @@ -1698,17 +1676,6 @@ "@types/yargs" "^15.0.0" chalk "^4.0.0" -"@jest/types@^27.4.0": - version "27.4.0" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-27.4.0.tgz#ac5c04d29ce47e0b96439dfd44ec3cd930fc9f86" - integrity sha512-jIsLdASXMf8GS7P7oGFGwobNse/6Ewq3GBPHoo0i6XRmja+NrUoDqJm4a1ffF2bHGleKJizxokcp1sCqSktP3g== - dependencies: - "@types/istanbul-lib-coverage" "^2.0.0" - "@types/istanbul-reports" "^3.0.0" - "@types/node" "*" - "@types/yargs" "^16.0.0" - chalk "^4.0.0" - "@jest/types@^28.1.3": version "28.1.3" resolved "https://registry.yarnpkg.com/@jest/types/-/types-28.1.3.tgz#b05de80996ff12512bc5ceb1d208285a7d11748b" @@ -2326,13 +2293,6 @@ resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.27.8.tgz#6667fac16c436b5434a387a34dedb013198f6e6e" integrity sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA== -"@sinonjs/commons@^1.7.0": - version "1.8.6" - resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.8.6.tgz#80c516a4dc264c2a69115e7578d62581ff455ed9" - integrity sha512-Ky+XkAkqPZSm3NLBeUng77EBQl3cmeJhITaGHdYH8kjVB+aun3S4XBRti2zt17mtt0mIUDiNxYeoJm6drVvBJQ== - dependencies: - type-detect "4.0.8" - "@sinonjs/commons@^3.0.0": version "3.0.1" resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-3.0.1.tgz#1029357e44ca901a615585f6d27738dbc89084cd" @@ -2347,13 +2307,6 @@ dependencies: "@sinonjs/commons" "^3.0.0" -"@sinonjs/fake-timers@^9.1.2": - version "9.1.2" - resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-9.1.2.tgz#4eaab737fab77332ab132d396a3c0d364bd0ea8c" - integrity sha512-BPS4ynJW/o92PUR4wgriz2Ud5gpST5vz6GQfMixEDK0Z8ZCUv2M7SkBLykH56T++Xs+8ln9zTGbOvNGIe02/jw== - dependencies: - "@sinonjs/commons" "^1.7.0" - "@stream-io/escape-string-regexp@^5.0.1": version "5.0.1" resolved "https://registry.yarnpkg.com/@stream-io/escape-string-regexp/-/escape-string-regexp-5.0.1.tgz#362505c92799fea6afe4e369993fbbda8690cc37" @@ -2402,50 +2355,25 @@ lz-string "^1.4.4" pretty-format "^26.6.2" -"@testing-library/dom@^8.5.0": - version "8.13.0" - resolved "https://registry.yarnpkg.com/@testing-library/dom/-/dom-8.13.0.tgz#bc00bdd64c7d8b40841e27a70211399ad3af46f5" - integrity sha512-9VHgfIatKNXQNaZTtLnalIy0jNZzY35a4S3oi08YAt9Hv1VsfZ/DfA45lM8D/UhtHBGJ4/lGwp0PZkVndRkoOQ== +"@testing-library/jest-dom@^6.6.3": + version "6.6.3" + resolved "https://registry.yarnpkg.com/@testing-library/jest-dom/-/jest-dom-6.6.3.tgz#26ba906cf928c0f8172e182c6fe214eb4f9f2bd2" + integrity sha512-IteBhl4XqYNkM54f4ejhLRJiZNqcSCoXUOG2CPK7qbD322KjQozM4kHQOfkG2oln9b9HTYqs+Sae8vBATubxxA== dependencies: - "@babel/code-frame" "^7.10.4" - "@babel/runtime" "^7.12.5" - "@types/aria-query" "^4.2.0" - aria-query "^5.0.0" - chalk "^4.1.0" - dom-accessibility-api "^0.5.9" - lz-string "^1.4.4" - pretty-format "^27.0.2" - -"@testing-library/jest-dom@^6.1.4": - version "6.1.4" - resolved "https://registry.yarnpkg.com/@testing-library/jest-dom/-/jest-dom-6.1.4.tgz#cf0835c33bc5ef00befb9e672b1e3e6a710e30e3" - integrity sha512-wpoYrCYwSZ5/AxcrjLxJmCU6I5QAJXslEeSiMQqaWmP2Kzpd1LvF/qxmAIW2qposULGWq2gw30GgVNFLSc2Jnw== - dependencies: - "@adobe/css-tools" "^4.3.1" - "@babel/runtime" "^7.9.2" + "@adobe/css-tools" "^4.4.0" aria-query "^5.0.0" chalk "^3.0.0" css.escape "^1.5.1" - dom-accessibility-api "^0.5.6" - lodash "^4.17.15" + dom-accessibility-api "^0.6.3" + lodash "^4.17.21" redent "^3.0.0" -"@testing-library/react-hooks@^8.0.0": - version "8.0.0" - resolved "https://registry.yarnpkg.com/@testing-library/react-hooks/-/react-hooks-8.0.0.tgz#7d0164bffce4647f506039de0a97f6fcbd20f4bf" - integrity sha512-uZqcgtcUUtw7Z9N32W13qQhVAD+Xki2hxbTR461MKax8T6Jr8nsUvZB+vcBTkzY2nFvsUet434CsgF0ncW2yFw== - dependencies: - "@babel/runtime" "^7.12.5" - react-error-boundary "^3.1.0" - -"@testing-library/react@^13.1.1": - version "13.1.1" - resolved "https://registry.yarnpkg.com/@testing-library/react/-/react-13.1.1.tgz#6c1635e25acca8ca5be8ee3b19ad1391681c5846" - integrity sha512-8mirlAa0OKaUvnqnZF6MdAh2tReYA2KtWVw1PKvaF5EcCZqgK5pl8iF+3uW90JdG5Ua2c2c2E2wtLdaug3dsVg== +"@testing-library/react@^16.2.0": + version "16.2.0" + resolved "https://registry.yarnpkg.com/@testing-library/react/-/react-16.2.0.tgz#c96126ee01a49cdb47175721911b4a9432afc601" + integrity sha512-2cSskAvA1QNtKc8Y9VJQRv0tm3hLVgxRGDB+KYhIaPQJ1I+RHbhIXcM+zClKXzMes/wshsMVzf4B9vS4IZpqDQ== dependencies: "@babel/runtime" "^7.12.5" - "@testing-library/dom" "^8.5.0" - "@types/react-dom" "^18.0.0" "@tootallnate/once@1": version "1.1.2" @@ -2554,14 +2482,22 @@ dependencies: "@types/istanbul-lib-report" "*" -"@types/jsdom@^16.2.4": - version "16.2.15" - resolved "https://registry.yarnpkg.com/@types/jsdom/-/jsdom-16.2.15.tgz#6c09990ec43b054e49636cba4d11d54367fc90d6" - integrity sha512-nwF87yjBKuX/roqGYerZZM0Nv1pZDMAT5YhOHYeM/72Fic+VEqJh4nyoqoapzJnW3pUlfxPY5FhgsJtM+dRnQQ== +"@types/jest@^29.5.14": + version "29.5.14" + resolved "https://registry.yarnpkg.com/@types/jest/-/jest-29.5.14.tgz#2b910912fa1d6856cadcd0c1f95af7df1d6049e5" + integrity sha512-ZN+4sdnLUbo8EVvVc2ao0GFW6oVrQRPn4K2lglySj7APvSrgzxHiNNK99us4WDMi57xxA2yggblIAMNhXOotLQ== + dependencies: + expect "^29.0.0" + pretty-format "^29.0.0" + +"@types/jsdom@^20.0.0": + version "20.0.1" + resolved "https://registry.yarnpkg.com/@types/jsdom/-/jsdom-20.0.1.tgz#07c14bc19bd2f918c1929541cdaacae894744808" + integrity sha512-d0r18sZPmMQr1eG35u12FZfhIXNrnsPU/g5wvRKCUf/tOGilKKwYMYGqh33BNR6ba+2gkHw1EUiHoN3mn7E5IQ== dependencies: "@types/node" "*" - "@types/parse5" "^6.0.3" "@types/tough-cookie" "*" + parse5 "^7.0.0" "@types/jsdom@^21.1.5": version "21.1.5" @@ -2689,23 +2625,11 @@ resolved "https://registry.yarnpkg.com/@types/parse-json/-/parse-json-4.0.0.tgz#2f8bb441434d163b35fb8ffdccd7138927ffb8c0" integrity sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA== -"@types/parse5@^6.0.3": - version "6.0.3" - resolved "https://registry.yarnpkg.com/@types/parse5/-/parse5-6.0.3.tgz#705bb349e789efa06f43f128cef51240753424cb" - integrity sha512-SuT16Q1K51EAVPz1K29DJ/sXjhSQ0zjvsypYJ6tlwVsRV9jwW5Adq2ch8Dq8kDBCkYnELS7N7VNCSB5nC56t/g== - "@types/prop-types@*", "@types/prop-types@^15.0.0": version "15.7.12" resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.12.tgz#12bb1e2be27293c1406acb6af1c3f3a1481d98c6" integrity sha512-5zvhXYtRNRluoE/jAp4GVsSduVUzNWKkOZrCDBWYtE7biZywwdC2AcEzg+cSMLFRfVgeAFqpfNabiPjxFddV1Q== -"@types/react-dom@^18.0.0": - version "18.2.19" - resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-18.2.19.tgz#b84b7c30c635a6c26c6a6dfbb599b2da9788be58" - integrity sha512-aZvQL6uUbIJpjZk4U8JZGbau9KDeAwMfmhyWorxgBkqDIEf6ROjRozcmPIicqsUwPUjbkDfHKgGee1Lq65APcA== - dependencies: - "@types/react" "*" - "@types/react-dom@^19.0.3": version "19.0.3" resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-19.0.3.tgz#0804dfd279a165d5a0ad8b53a5b9e65f338050a4" @@ -2805,13 +2729,6 @@ dependencies: "@types/yargs-parser" "*" -"@types/yargs@^16.0.0": - version "16.0.4" - resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-16.0.4.tgz#26aad98dd2c2a38e421086ea9ad42b9e51642977" - integrity sha512-T8Yc9wt/5LbJyCaLiHPReJa0kApcIgJ7Bn735GjItUfh08Z1pJvu8QZqb9s+mMvKV6WUQRV7K2R46YbjMXTTJw== - dependencies: - "@types/yargs-parser" "*" - "@types/yargs@^17.0.8": version "17.0.32" resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-17.0.32.tgz#030774723a2f7faafebf645f4e5a48371dca6229" @@ -3038,7 +2955,7 @@ JSONStream@^1.0.4, JSONStream@^1.3.5: jsonparse "^1.2.0" through ">=2.2.7 <3" -abab@^2.0.5, abab@^2.0.6: +abab@^2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.6.tgz#41b80f2c871d19686216b82309231cfd3cb3d291" integrity sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA== @@ -3056,33 +2973,35 @@ accepts@~1.3.8: mime-types "~2.1.34" negotiator "0.6.3" -acorn-globals@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-6.0.0.tgz#46cdd39f0f8ff08a876619b55f5ac8a6dc770b45" - integrity sha512-ZQl7LOWaF5ePqqcX4hLuv/bLXYQNfNWw2c0/yX/TsPRKamzHcTGQnlCjHT3TsmkOUVEPS3crCxiPfdzE/Trlhg== +acorn-globals@^7.0.0: + version "7.0.1" + resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-7.0.1.tgz#0dbf05c44fa7c94332914c02066d5beff62c40c3" + integrity sha512-umOSDSDrfHbTNPuNpC2NSnnA3LUrqpevPb4T9jRx4MagXNS0rs+gwiTcAvqCRmsD6utzsrzNt+ebm00SNWiC3Q== dependencies: - acorn "^7.1.1" - acorn-walk "^7.1.1" + acorn "^8.1.0" + acorn-walk "^8.0.2" acorn-jsx@^5.2.0, acorn-jsx@^5.3.1: version "5.3.2" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== -acorn-walk@^7.1.1: - version "7.2.0" - resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-7.2.0.tgz#0de889a601203909b0fbe07b8938dc21d2e967bc" - integrity sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA== +acorn-walk@^8.0.2: + version "8.3.4" + resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.3.4.tgz#794dd169c3977edf4ba4ea47583587c5866236b7" + integrity sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g== + dependencies: + acorn "^8.11.0" acorn@^7.1.1, acorn@^7.4.0: version "7.4.1" resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== -acorn@^8.5.0: - version "8.11.2" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.11.2.tgz#ca0d78b51895be5390a5903c5b3bdcdaf78ae40b" - integrity sha512-nc0Axzp/0FILLEVsm4fNwLCwMttvhEI263QtVPQcbpfZZ3ts0hLsZGOpE6czNlid7CJ9MlyH8reXkpsf3YUY4w== +acorn@^8.1.0, acorn@^8.11.0, acorn@^8.8.1: + version "8.14.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.14.0.tgz#063e2c70cac5fb4f6467f0b11152e04c682795b0" + integrity sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA== agent-base@5: version "5.1.1" @@ -3426,6 +3345,11 @@ async-each@^1.0.1: resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.6.tgz#52f1d9403818c179b7561e11a5d1b77eb2160e77" integrity sha512-c646jH1avxr+aVpndVMeAfYw7wAa6idufrlN3LPA4PmKS0QEGp6PIC9nwz0WQkkvBGAMEki3pFdtxaF39J9vvg== +async@^3.2.3: + version "3.2.6" + resolved "https://registry.yarnpkg.com/async/-/async-3.2.6.tgz#1b0728e14929d51b85b449b7f06e27c1145e38ce" + integrity sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA== + asynckit@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" @@ -3916,11 +3840,6 @@ brorand@^1.0.1, brorand@^1.1.0: resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" integrity sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w== -browser-process-hrtime@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz#3c9b4b7d782c8121e56f10106d84c0d0ffc94626" - integrity sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow== - browserify-aes@^1.0.0, browserify-aes@^1.0.4: version "1.2.0" resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-1.2.0.tgz#326734642f403dabc3003209853bb70ad428ef48" @@ -3985,7 +3904,7 @@ browserslist@^4.16.3, browserslist@^4.19.1, browserslist@^4.22.2: node-releases "^2.0.14" update-browserslist-db "^1.0.16" -bs-logger@0.x: +bs-logger@^0.2.6: version "0.2.6" resolved "https://registry.yarnpkg.com/bs-logger/-/bs-logger-0.2.6.tgz#eb7d365307a72cf974cc6cda76b68354ad336bd8" integrity sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog== @@ -4125,7 +4044,7 @@ ccount@^2.0.0: resolved "https://registry.yarnpkg.com/ccount/-/ccount-2.0.1.tgz#17a3bf82302e0870d6da43a01311a8bc02a3ecf5" integrity sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg== -chalk@4.1.2, chalk@^4.0.0, chalk@^4.1.0, chalk@^4.1.2: +chalk@4.1.2, chalk@^4.0.0, chalk@^4.0.2, chalk@^4.1.0, chalk@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== @@ -4866,7 +4785,7 @@ dargs@^7.0.0: resolved "https://registry.yarnpkg.com/dargs/-/dargs-7.0.0.tgz#04015c41de0bcb69ec84050f3d9be0caf8d6d5cc" integrity sha512-2iy1EkLdlBzQGvbweYRFxmFath8+K7+AKB0TlhHWkNuH+TmovaMH/Wp7V7R4u7f4SnX3OgLsU9t1NI9ioDnUpg== -data-urls@^3.0.1: +data-urls@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/data-urls/-/data-urls-3.0.2.tgz#9cf24a477ae22bcef5cd5f6f0bfbc1d2d3be9143" integrity sha512-Jy/tj3ldjZJo63sVAvg6LHt2mHvl4V6AgRAmNDtLdm7faqtsx+aJG42rsyCo9JCoRVKwPFzKlIPx3DIibwSIaQ== @@ -4944,7 +4863,7 @@ decamelize@^1.1.0: resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" integrity sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA== -decimal.js@^10.3.1, decimal.js@^10.4.3: +decimal.js@^10.4.2, decimal.js@^10.4.3: version "10.4.3" resolved "https://registry.yarnpkg.com/decimal.js/-/decimal.js-10.4.3.tgz#1044092884d245d1b7f65725fa4ad4c6f781cc23" integrity sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA== @@ -5141,11 +5060,16 @@ doctrine@^3.0.0: dependencies: esutils "^2.0.2" -dom-accessibility-api@^0.5.4, dom-accessibility-api@^0.5.6, dom-accessibility-api@^0.5.9: +dom-accessibility-api@^0.5.4: version "0.5.13" resolved "https://registry.yarnpkg.com/dom-accessibility-api/-/dom-accessibility-api-0.5.13.tgz#102ee5f25eacce09bdf1cfa5a298f86da473be4b" integrity sha512-R305kwb5CcMDIpSHUnLyIAp7SrSPBx6F0VfQFB3M75xVMHhXJJIdePYgbPPh1o57vCHNu5QztokWUPsLjWzFqw== +dom-accessibility-api@^0.6.3: + version "0.6.3" + resolved "https://registry.yarnpkg.com/dom-accessibility-api/-/dom-accessibility-api-0.6.3.tgz#993e925cc1d73f2c662e7d75dd5a5445259a8fd8" + integrity sha512-7ZgogeTnjuHbo+ct10G9Ffp0mif17idi0IyWNVA/wcwcm7NPOD/WEHVP3n7n3MhXqxoIYm8d6MuZohYWIZ4T3w== + dom-serializer@^1.0.1: version "1.4.1" resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-1.4.1.tgz#de5d41b1aea290215dc45a6dae8adcf1d32e2d30" @@ -5261,6 +5185,13 @@ ee-first@1.1.1: resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" integrity sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow== +ejs@^3.1.10: + version "3.1.10" + resolved "https://registry.yarnpkg.com/ejs/-/ejs-3.1.10.tgz#69ab8358b14e896f80cc39e62087b88500c3ac3b" + integrity sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA== + dependencies: + jake "^10.8.5" + electron-to-chromium@^1.4.796: version "1.4.798" resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.798.tgz#6a3fcab2edc1e66e3883466f6b4b8944323c0164" @@ -5350,6 +5281,11 @@ entities@^4.2.0, entities@^4.3.0, entities@^4.4.0: resolved "https://registry.yarnpkg.com/entities/-/entities-4.4.0.tgz#97bdaba170339446495e653cfd2db78962900174" integrity sha512-oYp7156SP8LkeGD0GF85ad1X9Ai79WtRsZ2gxJqtBuzH+98YUV6jkHEKlZkMbcrjJjIVJNIDP/3WL9wQkoPbWA== +entities@^4.5.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/entities/-/entities-4.5.0.tgz#5d268ea5e7113ec74c4d033b79ea5a35a488fb48" + integrity sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw== + env-ci@^5.0.0: version "5.5.0" resolved "https://registry.yarnpkg.com/env-ci/-/env-ci-5.5.0.tgz#43364e3554d261a586dec707bc32be81112b545f" @@ -6070,7 +6006,7 @@ expand-brackets@^2.1.4: snapdragon "^0.8.1" to-regex "^3.0.1" -expect@^29.7.0: +expect@^29.0.0, expect@^29.7.0: version "29.7.0" resolved "https://registry.yarnpkg.com/expect/-/expect-29.7.0.tgz#578874590dcb3214514084c08115d8aee61e11bc" integrity sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw== @@ -6235,6 +6171,13 @@ file-selector@^0.6.0: dependencies: tslib "^2.4.0" +filelist@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/filelist/-/filelist-1.0.4.tgz#f78978a1e944775ff9e62e744424f215e58352b5" + integrity sha512-w1cEuf3S+DrLCQL7ET6kz+gmlJdbq9J7yXCSjK/OZCPA+qEN1WyF4ZAf0YYJa4/shHJra2t/d/r8SV4Ji+x+8Q== + dependencies: + minimatch "^5.0.1" + fill-range@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" @@ -7088,7 +7031,7 @@ https-proxy-agent@^4.0.0: agent-base "5" debug "4" -https-proxy-agent@^5.0.0: +https-proxy-agent@^5.0.0, https-proxy-agent@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz#c59ef224a04fe8b754f3db0063a25ea30d0005d6" integrity sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA== @@ -7821,6 +7764,16 @@ istanbul-reports@^3.1.3: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" +jake@^10.8.5: + version "10.9.2" + resolved "https://registry.yarnpkg.com/jake/-/jake-10.9.2.tgz#6ae487e6a69afec3a5e167628996b59f35ae2b7f" + integrity sha512-2P4SQ0HrLQ+fw6llpLnOaGAvN2Zu6778SJMrCUwns4fOoG9ayrTiZk3VV8sCPkVZF8ab0zksVpS8FDY5pRCNBA== + dependencies: + async "^3.2.3" + chalk "^4.0.2" + filelist "^1.0.4" + minimatch "^3.1.2" + java-properties@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/java-properties/-/java-properties-1.0.2.tgz#ccd1fa73907438a5b5c38982269d0e771fe78211" @@ -7944,19 +7897,19 @@ jest-each@^29.7.0: jest-util "^29.7.0" pretty-format "^29.7.0" -jest-environment-jsdom@^28.1.3: - version "28.1.3" - resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-28.1.3.tgz#2d4e5d61b7f1d94c3bddfbb21f0308ee506c09fb" - integrity sha512-HnlGUmZRdxfCByd3GM2F100DgQOajUBzEitjGqIREcb45kGjZvRrKUdlaF6escXBdcXNl0OBh+1ZrfeZT3GnAg== +jest-environment-jsdom@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-29.7.0.tgz#d206fa3551933c3fd519e5dfdb58a0f5139a837f" + integrity sha512-k9iQbsf9OyOfdzWH8HDmrRT0gSIcX+FLNW7IQq94tFX0gynPwqDTW0Ho6iMVNjGz/nb+l/vW3dWM2bbLLpkbXA== dependencies: - "@jest/environment" "^28.1.3" - "@jest/fake-timers" "^28.1.3" - "@jest/types" "^28.1.3" - "@types/jsdom" "^16.2.4" + "@jest/environment" "^29.7.0" + "@jest/fake-timers" "^29.7.0" + "@jest/types" "^29.6.3" + "@types/jsdom" "^20.0.0" "@types/node" "*" - jest-mock "^28.1.3" - jest-util "^28.1.3" - jsdom "^19.0.0" + jest-mock "^29.7.0" + jest-util "^29.7.0" + jsdom "^20.0.0" jest-environment-node@^29.7.0: version "29.7.0" @@ -8041,21 +7994,6 @@ jest-matcher-utils@^29.7.0: jest-get-type "^29.6.3" pretty-format "^29.7.0" -jest-message-util@^28.1.3: - version "28.1.3" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-28.1.3.tgz#232def7f2e333f1eecc90649b5b94b0055e7c43d" - integrity sha512-PFdn9Iewbt575zKPf1286Ht9EPoJmYT7P0kY+RibeYZ2XtOr53pDLEFoTWXbd1h4JiGiWpTBC84fc8xMXQMb7g== - dependencies: - "@babel/code-frame" "^7.12.13" - "@jest/types" "^28.1.3" - "@types/stack-utils" "^2.0.0" - chalk "^4.0.0" - graceful-fs "^4.2.9" - micromatch "^4.0.4" - pretty-format "^28.1.3" - slash "^3.0.0" - stack-utils "^2.0.3" - jest-message-util@^29.7.0: version "29.7.0" resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.7.0.tgz#8bc392e204e95dfe7564abbe72a404e28e51f7f3" @@ -8071,14 +8009,6 @@ jest-message-util@^29.7.0: slash "^3.0.0" stack-utils "^2.0.3" -jest-mock@^28.1.3: - version "28.1.3" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-28.1.3.tgz#d4e9b1fc838bea595c77ab73672ebf513ab249da" - integrity sha512-o3J2jr6dMMWYVH4Lh/NKmDXdosrsJgi4AviS8oXLujcjpCMBb1FMsblDnOXKZKfSiHLxYub1eS0IHuRXsio9eA== - dependencies: - "@jest/types" "^28.1.3" - "@types/node" "*" - jest-mock@^29.7.0: version "29.7.0" resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-29.7.0.tgz#4e836cf60e99c6fcfabe9f99d017f3fdd50a6347" @@ -8324,37 +8254,36 @@ js-yaml@^3.13.1: argparse "^1.0.7" esprima "^4.0.0" -jsdom@^19.0.0: - version "19.0.0" - resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-19.0.0.tgz#93e67c149fe26816d38a849ea30ac93677e16b6a" - integrity sha512-RYAyjCbxy/vri/CfnjUWJQQtZ3LKlLnDqj+9XLNnJPgEGeirZs3hllKR20re8LUZ6o1b1X4Jat+Qd26zmP41+A== +jsdom@^20.0.0: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-20.0.3.tgz#886a41ba1d4726f67a8858028c99489fed6ad4db" + integrity sha512-SYhBvTh89tTfCD/CRdSOm13mOBa42iTaTyfyEWBdKcGdPxPtLFBXuHR8XHb33YNYaP+lLbmSvBTsnoesCNJEsQ== dependencies: - abab "^2.0.5" - acorn "^8.5.0" - acorn-globals "^6.0.0" + abab "^2.0.6" + acorn "^8.8.1" + acorn-globals "^7.0.0" cssom "^0.5.0" cssstyle "^2.3.0" - data-urls "^3.0.1" - decimal.js "^10.3.1" + data-urls "^3.0.2" + decimal.js "^10.4.2" domexception "^4.0.0" escodegen "^2.0.0" form-data "^4.0.0" html-encoding-sniffer "^3.0.0" http-proxy-agent "^5.0.0" - https-proxy-agent "^5.0.0" + https-proxy-agent "^5.0.1" is-potential-custom-element-name "^1.0.1" - nwsapi "^2.2.0" - parse5 "6.0.1" - saxes "^5.0.1" + nwsapi "^2.2.2" + parse5 "^7.1.1" + saxes "^6.0.0" symbol-tree "^3.2.4" - tough-cookie "^4.0.0" - w3c-hr-time "^1.0.2" - w3c-xmlserializer "^3.0.0" + tough-cookie "^4.1.2" + w3c-xmlserializer "^4.0.0" webidl-conversions "^7.0.0" whatwg-encoding "^2.0.0" whatwg-mimetype "^3.0.0" - whatwg-url "^10.0.0" - ws "^8.2.3" + whatwg-url "^11.0.0" + ws "^8.11.0" xml-name-validator "^4.0.0" jsdom@^24.1.1: @@ -8861,7 +8790,7 @@ lodash.kebabcase@^4.1.1: resolved "https://registry.yarnpkg.com/lodash.kebabcase/-/lodash.kebabcase-4.1.1.tgz#8489b1cb0d29ff88195cceca448ff6d6cc295c36" integrity sha512-N8XRTIMMqqDgSy4VLKPnJ/+hpGZN+PHQiJnSenYqPaVV/NCqEogTnAdZLQiGKhxX+JCs8waWq2t1XHWKOmlY8g== -lodash.memoize@4.x: +lodash.memoize@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe" integrity sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag== @@ -8927,7 +8856,7 @@ longest-streak@^3.0.0: resolved "https://registry.yarnpkg.com/longest-streak/-/longest-streak-3.0.1.tgz#c97315b7afa0e7d9525db9a5a2953651432bdc5d" integrity sha512-cHlYSUpL2s7Fb3394mYxwTYj8niTaNHUCLr0qdiCXQfSjfuA7CKofpX2uSwEfFDQ0EB7JcnMnm+GjbqqoinYYg== -loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.4.0: +loose-envify@^1.0.0, loose-envify@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== @@ -8980,7 +8909,7 @@ make-dir@^4.0.0: dependencies: semver "^7.5.3" -make-error@1.x: +make-error@^1.3.6: version "1.3.6" resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== @@ -9659,7 +9588,7 @@ minimalistic-crypto-utils@^1.0.1: resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" integrity sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg== -minimatch@^3.0.2, minimatch@^3.0.4, minimatch@^3.1.1: +minimatch@^3.0.2, minimatch@^3.0.4, minimatch@^3.1.1, minimatch@^3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== @@ -10214,11 +10143,16 @@ nth-check@^2.0.1: dependencies: boolbase "^1.0.0" -nwsapi@^2.2.0, nwsapi@^2.2.12: +nwsapi@^2.2.12: version "2.2.12" resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.2.12.tgz#fb6af5c0ec35b27b4581eb3bbad34ec9e5c696f8" integrity sha512-qXDmcVlZV4XRtKFzddidpfVP4oMSGhga+xdMc25mv8kaLUHtgzCDhUxkrN8exkGdTlLNaXj7CV3GtON7zuGZ+w== +nwsapi@^2.2.2: + version "2.2.16" + resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.2.16.tgz#177760bba02c351df1d2644e220c31dfec8cdb43" + integrity sha512-F1I/bimDpj3ncaNDhfyMWuFqmQDBwDB0Fogc2qpL3BWvkQteFD/8BzWuIRl83rq0DXfm8SGt/HFhLXZyljTXcQ== + object-assign@^4.1.0, object-assign@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" @@ -10573,11 +10507,6 @@ parse5-htmlparser2-tree-adapter@^7.0.0: domhandler "^5.0.2" parse5 "^7.0.0" -parse5@6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/parse5/-/parse5-6.0.1.tgz#e1a1c085c569b3dc08321184f19a39cc27f7c30b" - integrity sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw== - parse5@^7.0.0, parse5@^7.1.2: version "7.1.2" resolved "https://registry.yarnpkg.com/parse5/-/parse5-7.1.2.tgz#0736bebbfd77793823240a23b7fc5e010b7f8e32" @@ -10585,6 +10514,13 @@ parse5@^7.0.0, parse5@^7.1.2: dependencies: entities "^4.4.0" +parse5@^7.1.1: + version "7.2.1" + resolved "https://registry.yarnpkg.com/parse5/-/parse5-7.2.1.tgz#8928f55915e6125f430cc44309765bf17556a33a" + integrity sha512-BuBYQYlv1ckiPdQi/ohiivi9Sagc9JG+Ozs0r7b/0iK3sKmrb0b9FdWdBbOdx6hBCM/F9Ir82ofnBhtZOjCRPQ== + dependencies: + entities "^4.5.0" + parseurl@~1.3.3: version "1.3.3" resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" @@ -10816,27 +10752,7 @@ pretty-format@^26.6.2: ansi-styles "^4.0.0" react-is "^17.0.1" -pretty-format@^27.0.2: - version "27.4.0" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.4.0.tgz#440a7b86612a18b0865831a6d8585d989a5420e9" - integrity sha512-n0QR6hMREfp6nLzfVksXMAfIxk1ffOOfbb/FzKHFmRtn9iJKaZXB8WMzLr8a72IASShEAhqK06nlwp1gVWgqKg== - dependencies: - "@jest/types" "^27.4.0" - ansi-regex "^5.0.1" - ansi-styles "^5.0.0" - react-is "^17.0.1" - -pretty-format@^28.1.3: - version "28.1.3" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-28.1.3.tgz#c9fba8cedf99ce50963a11b27d982a9ae90970d5" - integrity sha512-8gFb/To0OmxHR9+ZTb14Df2vNxdGCX8g1xWGUTqUw5TiZvcQf5sHKObd5UcPyLLyowNwDAMTF3XWOG1B6mxl1Q== - dependencies: - "@jest/schemas" "^28.1.3" - ansi-regex "^5.0.1" - ansi-styles "^5.0.0" - react-is "^18.0.0" - -pretty-format@^29.2.1, pretty-format@^29.7.0: +pretty-format@^29.0.0, pretty-format@^29.2.1, pretty-format@^29.7.0: version "29.7.0" resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.7.0.tgz#ca42c758310f365bfa71a0bda0a807160b776812" integrity sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ== @@ -11106,13 +11022,6 @@ react-dropzone@^14.2.3: file-selector "^0.6.0" prop-types "^15.8.1" -react-error-boundary@^3.1.0: - version "3.1.4" - resolved "https://registry.yarnpkg.com/react-error-boundary/-/react-error-boundary-3.1.4.tgz#255db92b23197108757a888b01e5b729919abde0" - integrity sha512-uM9uPzZJTF6wRQORmSrvOIgt4lJ9MC1sNgEOj2XGsDTRE4kmpWxg7ENK9EWNKJRMAOY9z0MuF4yIfl6gp4sotA== - dependencies: - "@babel/runtime" "^7.12.5" - react-fast-compare@^3.0.1, react-fast-compare@^3.2.2: version "3.2.2" resolved "https://registry.yarnpkg.com/react-fast-compare/-/react-fast-compare-3.2.2.tgz#929a97a532304ce9fee4bcae44234f1ce2c21d49" @@ -11123,11 +11032,6 @@ react-image-gallery@1.2.12: resolved "https://registry.yarnpkg.com/react-image-gallery/-/react-image-gallery-1.2.12.tgz#b08a633cc336bab2a5afdb96941e023925043c6a" integrity sha512-JIh85lh0Av/yewseGJb/ycg00Y/weQiZEC/BQueC2Z5jnYILGB6mkxnrOevNhsM2NdZJpvcDekCluhy6uzEoTA== -"react-is@^16.12.0 || ^17.0.0 || ^18.0.0", react-is@^18.0.0, react-is@^18.1.0: - version "18.3.1" - resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.3.1.tgz#e83557dc12eae63a99e003a46388b1dcbb44db7e" - integrity sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg== - react-is@^16.13.1, react-is@^16.8.6: version "16.13.1" resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" @@ -11138,6 +11042,11 @@ react-is@^17.0.1: resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.2.tgz#e691d4a8e9c789365655539ab372762b0efb54f0" integrity sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w== +react-is@^18.0.0, react-is@^18.1.0: + version "18.3.1" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.3.1.tgz#e83557dc12eae63a99e003a46388b1dcbb44db7e" + integrity sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg== + react-markdown@^5.0.3: version "5.0.3" resolved "https://registry.yarnpkg.com/react-markdown/-/react-markdown-5.0.3.tgz#41040ea7a9324b564b328fb81dd6c04f2a5373ac" @@ -11199,23 +11108,6 @@ react-refresh@^0.12.0: resolved "https://registry.yarnpkg.com/react-refresh/-/react-refresh-0.12.0.tgz#28ac0a2c30ef2bb3433d5fd0621e69a6d774c3a4" integrity sha512-suLIhrU2IHKL5JEKR/fAwJv7bbeq4kJ+pJopf77jHwuR+HmJS/HbrPIGsTBUVfw7tXPOmYv7UJ7PCaN49e8x4A== -react-shallow-renderer@^16.15.0: - version "16.15.0" - resolved "https://registry.yarnpkg.com/react-shallow-renderer/-/react-shallow-renderer-16.15.0.tgz#48fb2cf9b23d23cde96708fe5273a7d3446f4457" - integrity sha512-oScf2FqQ9LFVQgA73vr86xl2NaOIX73rh+YFqcOp68CWj56tSfgtGKrEbyhCj0rSijyG9M1CYprTh39fBi5hzA== - dependencies: - object-assign "^4.1.1" - react-is "^16.12.0 || ^17.0.0 || ^18.0.0" - -react-test-renderer@^18.1.0: - version "18.1.0" - resolved "https://registry.yarnpkg.com/react-test-renderer/-/react-test-renderer-18.1.0.tgz#35b75754834cf9ab517b6813db94aee0a6b545c3" - integrity sha512-OfuueprJFW7h69GN+kr4Ywin7stcuqaYAt1g7airM5cUgP0BoF5G5CXsPGmXeDeEkncb2fqYNECO4y18sSqphg== - dependencies: - react-is "^18.1.0" - react-shallow-renderer "^16.15.0" - scheduler "^0.22.0" - react-textarea-autosize@^8.3.0: version "8.3.2" resolved "https://registry.yarnpkg.com/react-textarea-autosize/-/react-textarea-autosize-8.3.2.tgz#4f9374d357b0a6f6469956726722549124a1b2db" @@ -11770,13 +11662,6 @@ safe-regex@^1.1.0: resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== -saxes@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/saxes/-/saxes-5.0.1.tgz#eebab953fa3b7608dbe94e5dadb15c888fa6696d" - integrity sha512-5LBh1Tls8c9xgGjw3QrMwETmTMVk0oFgvrFSvWx62llR2hcEInrKNZ2GZCCuuy2lvWrdl5jhbpeqc5hRYKFOcw== - dependencies: - xmlchars "^2.2.0" - saxes@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/saxes/-/saxes-6.0.0.tgz#fe5b4a4768df4f14a201b1ba6a65c1f3d9988cc5" @@ -11784,13 +11669,6 @@ saxes@^6.0.0: dependencies: xmlchars "^2.2.0" -scheduler@^0.22.0: - version "0.22.0" - resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.22.0.tgz#83a5d63594edf074add9a7198b1bae76c3db01b8" - integrity sha512-6QAm1BgQI88NPYymgGQLCZgvep4FyePDWFpXVK+zNSUgHwlqpJy8VEh8Et0KxTACS4VWwMousBElAZOH9nkkoQ== - dependencies: - loose-envify "^1.1.0" - scheduler@^0.25.0: version "0.25.0" resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.25.0.tgz#336cd9768e8cceebf52d3c80e3dcf5de23e7e015" @@ -11869,6 +11747,11 @@ semver@^7.0.0, semver@^7.1.1, semver@^7.1.2, semver@^7.2.1, semver@^7.3.2, semve resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.2.tgz#1e3b34759f896e8f14d6134732ce798aeb0c6e13" integrity sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w== +semver@^7.6.3: + version "7.6.3" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.3.tgz#980f7b5550bc175fb4dc09403085627f9eb33143" + integrity sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A== + send@0.18.0: version "0.18.0" resolved "https://registry.yarnpkg.com/send/-/send-0.18.0.tgz#670167cc654b05f5aa4a767f9113bb371bc706be" @@ -12687,7 +12570,7 @@ toidentifier@1.0.1: resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.1.tgz#3be34321a88a820ed1bd80dfaa33e479fbb8dd35" integrity sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA== -tough-cookie@^4.0.0, tough-cookie@^4.1.4: +tough-cookie@^4.1.2, tough-cookie@^4.1.4: version "4.1.4" resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-4.1.4.tgz#945f1461b45b5a8c76821c33ea49c3ac192c1b36" integrity sha512-Loo5UUvLD9ScZ6jh8beX1T6sO1w2/MpCRpEP7V280GKMVUQ0Jzar2U3UJPsrdbziLEMMhu3Ujnq//rhiFuIeag== @@ -12756,19 +12639,20 @@ ts-essentials@^2.0.3: resolved "https://registry.yarnpkg.com/ts-essentials/-/ts-essentials-2.0.12.tgz#c9303f3d74f75fa7528c3d49b80e089ab09d8745" integrity sha512-3IVX4nI6B5cc31/GFFE+i8ey/N2eA0CZDbo6n0yrz0zDX8ZJ8djmU1p+XRz7G3is0F3bB3pu2pAroFdAWQKU3w== -ts-jest@^29.1.4: - version "29.1.4" - resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-29.1.4.tgz#26f8a55ce31e4d2ef7a1fd47dc7fa127e92793ef" - integrity sha512-YiHwDhSvCiItoAgsKtoLFCuakDzDsJ1DLDnSouTaTmdOcOwIkSzbLXduaQ6M5DRVhuZC/NYaaZ/mtHbWMv/S6Q== +ts-jest@^29.2.5: + version "29.2.5" + resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-29.2.5.tgz#591a3c108e1f5ebd013d3152142cb5472b399d63" + integrity sha512-KD8zB2aAZrcKIdGk4OwpJggeLcH1FgrICqDSROWqlnJXGCXK4Mn6FcdK2B6670Xr73lHMG1kHw8R87A0ecZ+vA== dependencies: - bs-logger "0.x" - fast-json-stable-stringify "2.x" + bs-logger "^0.2.6" + ejs "^3.1.10" + fast-json-stable-stringify "^2.1.0" jest-util "^29.0.0" json5 "^2.2.3" - lodash.memoize "4.x" - make-error "1.x" - semver "^7.5.3" - yargs-parser "^21.0.1" + lodash.memoize "^4.1.2" + make-error "^1.3.6" + semver "^7.6.3" + yargs-parser "^21.1.1" tsconfig-paths@^3.9.0: version "3.9.0" @@ -13410,17 +13294,10 @@ vue-template-compiler@^2.6.11: de-indent "^1.0.2" he "^1.2.0" -w3c-hr-time@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz#0a89cdf5cc15822df9c360543676963e0cc308cd" - integrity sha512-z8P5DvDNjKDoFIHK7q8r8lackT6l+jo/Ye3HOle7l9nICP9lf1Ci25fy9vHd0JOWewkIFzXIEig3TdKT7JQ5fQ== - dependencies: - browser-process-hrtime "^1.0.0" - -w3c-xmlserializer@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/w3c-xmlserializer/-/w3c-xmlserializer-3.0.0.tgz#06cdc3eefb7e4d0b20a560a5a3aeb0d2d9a65923" - integrity sha512-3WFqGEgSXIyGhOmAFtlicJNMjEps8b1MG31NCA0/vOF9+nKMUW1ckhi9cnNHmf88Rzw5V+dwIwsm2C7X8k9aQg== +w3c-xmlserializer@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/w3c-xmlserializer/-/w3c-xmlserializer-4.0.0.tgz#aebdc84920d806222936e3cdce408e32488a3073" + integrity sha512-d+BFHzbiCx6zGfz0HyQ6Rg69w9k19nviJspaj4yNscGjrHu94sVP+aRm75yEbCh+r2/yR+7q6hux9LVtbuTGBw== dependencies: xml-name-validator "^4.0.0" @@ -13501,14 +13378,6 @@ whatwg-mimetype@^4.0.0: resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-4.0.0.tgz#bc1bf94a985dc50388d54a9258ac405c3ca2fc0a" integrity sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg== -whatwg-url@^10.0.0: - version "10.0.0" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-10.0.0.tgz#37264f720b575b4a311bd4094ed8c760caaa05da" - integrity sha512-CLxxCmdUby142H5FZzn4D8ikO1cmypvXVQktsgosNy4a4BHrDHeciBBGZhb0bNoR5/MltoCatso+vFjjGx8t0w== - dependencies: - tr46 "^3.0.0" - webidl-conversions "^7.0.0" - whatwg-url@^11.0.0: version "11.0.0" resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-11.0.0.tgz#0a849eebb5faf2119b901bb76fd795c2848d4018" @@ -13630,7 +13499,7 @@ ws@^7.5.10: resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.10.tgz#58b5c20dc281633f6c19113f39b349bd8bd558d9" integrity sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ== -ws@^8.18.0, ws@^8.2.3: +ws@^8.11.0, ws@^8.18.0: version "8.18.0" resolved "https://registry.yarnpkg.com/ws/-/ws-8.18.0.tgz#0d7505a6eafe2b0e712d232b42279f53bc289bbc" integrity sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw== @@ -13685,7 +13554,7 @@ yargs-parser@^20.2.2, yargs-parser@^20.2.3: resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== -yargs-parser@^21.0.1, yargs-parser@^21.1.1: +yargs-parser@^21.1.1: version "21.1.1" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.1.1.tgz#9096bceebf990d21bb31fa9516e0ede294a77d35" integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==