diff --git a/.deps/dev.md b/.deps/dev.md index fe3ac84b6..706513569 100644 --- a/.deps/dev.md +++ b/.deps/dev.md @@ -28,7 +28,6 @@ | [`@babel/parser@7.23.0`](https://github.com/babel/babel.git) | MIT | #10663 | | [`@babel/plugin-syntax-jsx@7.22.5`](https://github.com/babel/babel.git) | MIT | #9014 | | [`@babel/plugin-syntax-typescript@7.22.5`](https://github.com/babel/babel.git) | MIT | #8994 | -| [`@babel/runtime-corejs3@7.23.2`](https://github.com/babel/babel.git) | MIT | clearlydefined | | [`@babel/template@7.22.15`](https://github.com/babel/babel.git) | MIT | #9017 | | [`@babel/traverse@7.23.2`](https://github.com/babel/babel.git) | MIT | #11520 | | [`@babel/types@7.23.0`](https://github.com/babel/babel.git) | MIT | #11521 | @@ -65,7 +64,6 @@ | [`@jest/test-result@29.7.0`](https://github.com/jestjs/jest.git) | MIT | clearlydefined | | [`@jest/test-sequencer@29.7.0`](https://github.com/jestjs/jest.git) | MIT | clearlydefined | | [`@jest/transform@29.7.0`](https://github.com/jestjs/jest.git) | MIT | clearlydefined | -| [`@jest/types@26.6.2`](https://github.com/facebook/jest.git) | MIT | clearlydefined | | [`@jest/types@29.6.3`](https://github.com/jestjs/jest.git) | MIT | clearlydefined | | `@jridgewell/gen-mapping@0.3.3` | MIT | clearlydefined | | `@jridgewell/resolve-uri@3.1.1` | MIT | clearlydefined | @@ -128,16 +126,16 @@ | [`@sinclair/typebox@0.27.8`](https://github.com/sinclairzx81/typebox) | MIT | clearlydefined | | [`@sinonjs/commons@3.0.0`](git+https://github.com/sinonjs/commons.git) | BSD-3-Clause | #12905 | | [`@sinonjs/fake-timers@10.3.0`](https://github.com/sinonjs/fake-timers.git) | BSD-3-Clause | #9214 | -| [`@testing-library/dom@7.31.2`](https://github.com/testing-library/dom-testing-library) | MIT | transitive dependency | -| [`@testing-library/jest-dom@6.1.4`](https://github.com/testing-library/jest-dom) | MIT | clearlydefined | -| [`@testing-library/react@10.4.9`](https://github.com/testing-library/react-testing-library) | MIT | clearlydefined | -| [`@testing-library/user-event@12.8.3`](https://github.com/testing-library/user-event) | MIT | clearlydefined | +| [`@testing-library/dom@10.4.0`](https://github.com/testing-library/dom-testing-library) | MIT | #15966 | +| [`@testing-library/jest-dom@6.5.0`](https://github.com/testing-library/jest-dom) | MIT | clearlydefined | +| [`@testing-library/react@16.0.1`](https://github.com/testing-library/react-testing-library) | MIT | clearlydefined | +| [`@testing-library/user-event@14.5.2`](https://github.com/testing-library/user-event) | MIT | clearlydefined | | [`@tootallnate/once@2.0.0`](git://github.com/TooTallNate/once.git) | MIT | clearlydefined | | `@trysound/sax@0.2.0` | ISC | clearlydefined | | [`@tufjs/canonical-json@1.0.0`](git+https://github.com/theupdateframework/tuf-js.git) | MIT | #8047 | | [`@tufjs/models@1.0.4`](git+https://github.com/theupdateframework/tuf-js.git) | MIT | #7600 | | [`@types/args@5.0.2`](https://github.com/DefinitelyTyped/DefinitelyTyped.git) | MIT | clearlydefined | -| [`@types/aria-query@4.2.2`](https://github.com/DefinitelyTyped/DefinitelyTyped.git) | MIT | clearlydefined | +| [`@types/aria-query@5.0.4`](https://github.com/DefinitelyTyped/DefinitelyTyped.git) | MIT | #10958 | | [`@types/babel__core@7.20.3`](https://github.com/DefinitelyTyped/DefinitelyTyped.git) | MIT | clearlydefined | | [`@types/babel__generator@7.6.6`](https://github.com/DefinitelyTyped/DefinitelyTyped.git) | MIT | clearlydefined | | [`@types/babel__template@7.4.3`](https://github.com/DefinitelyTyped/DefinitelyTyped.git) | MIT | clearlydefined | @@ -166,16 +164,14 @@ | [`@types/react-copy-to-clipboard@4.3.0`](https://github.com/DefinitelyTyped/DefinitelyTyped.git) | MIT | clearlydefined | | [`@types/react-router-dom@5.3.3`](https://github.com/DefinitelyTyped/DefinitelyTyped.git) | MIT | clearlydefined | | [`@types/react-router@5.1.20`](https://github.com/DefinitelyTyped/DefinitelyTyped.git) | MIT | clearlydefined | -| [`@types/react-test-renderer@18.0.5`](https://github.com/DefinitelyTyped/DefinitelyTyped.git) | MIT | clearlydefined | +| [`@types/react-test-renderer@18.3.0`](https://github.com/DefinitelyTyped/DefinitelyTyped.git) | MIT | clearlydefined | | [`@types/redux-mock-store@1.0.5`](https://github.com/DefinitelyTyped/DefinitelyTyped.git) | MIT | clearlydefined | | [`@types/request@2.48.12`](https://github.com/DefinitelyTyped/DefinitelyTyped.git) | MIT | clearlydefined | | [`@types/sanitize-html@2.9.3`](https://github.com/DefinitelyTyped/DefinitelyTyped.git) | MIT | clearlydefined | | [`@types/semver@7.5.4`](https://github.com/DefinitelyTyped/DefinitelyTyped.git) | MIT | #10842 | | [`@types/stack-utils@2.0.2`](https://github.com/DefinitelyTyped/DefinitelyTyped.git) | MIT | clearlydefined | -| [`@types/testing-library__jest-dom@5.14.9`](https://github.com/DefinitelyTyped/DefinitelyTyped.git) | MIT | #9436 | | [`@types/webpack@5.28.5`](https://github.com/DefinitelyTyped/DefinitelyTyped.git) | MIT | clearlydefined | | [`@types/yargs-parser@21.0.2`](https://github.com/DefinitelyTyped/DefinitelyTyped.git) | MIT | clearlydefined | -| [`@types/yargs@15.0.17`](https://github.com/DefinitelyTyped/DefinitelyTyped.git) | MIT | #6241 | | [`@types/yargs@17.0.29`](https://github.com/DefinitelyTyped/DefinitelyTyped.git) | MIT | #7054 | | [`@typescript-eslint/eslint-plugin@6.10.0`](https://github.com/typescript-eslint/typescript-eslint.git) | MIT | #14420 | | [`@typescript-eslint/parser@6.10.0`](https://github.com/typescript-eslint/typescript-eslint.git) | BSD-2-Clause | clearlydefined | @@ -227,7 +223,6 @@ | [`are-we-there-yet@3.0.1`](https://github.com/npm/are-we-there-yet.git) | ISC | clearlydefined | | [`are-we-there-yet@4.0.2`](https://github.com/npm/are-we-there-yet.git) | ISC | clearlydefined | | `argparse@1.0.10` | MIT | #2174 | -| [`aria-query@4.2.2`](git+https://github.com/A11yance/aria-query.git) | Apache-2.0 | clearlydefined | | [`aria-query@5.3.0`](git+https://github.com/A11yance/aria-query.git) | Apache-2.0 | clearlydefined | | [`array-buffer-byte-length@1.0.0`](git+https://github.com/inspect-js/array-buffer-byte-length.git) | MIT | #7548 | | `array-differ@3.0.0` | MIT | clearlydefined | @@ -331,7 +326,6 @@ | [`conventional-recommended-bump@6.1.0`](https://github.com/conventional-changelog/conventional-changelog.git) | MIT | clearlydefined | | [`convert-source-map@2.0.0`](git://github.com/thlorenz/convert-source-map.git) | MIT | clearlydefined | | [`copy-webpack-plugin@11.0.0`](https://github.com/webpack-contrib/copy-webpack-plugin) | MIT | clearlydefined | -| [`core-js-pure@3.33.2`](https://github.com/zloirock/core-js.git) | MIT | #10961 | | [`core-util-is@1.0.3`](git://github.com/isaacs/core-util-is) | MIT | #5898 | | [`cosmiconfig@7.0.0`](git+https://github.com/davidtheclark/cosmiconfig.git) | MIT | clearlydefined | | [`cosmiconfig@8.3.6`](git+https://github.com/cosmiconfig/cosmiconfig.git) | MIT | #10781 | @@ -386,6 +380,7 @@ | [`doctrine@2.1.0`](https://github.com/eslint/doctrine) | Apache-2.0 | #15247 | | [`doctrine@3.0.0`](https://github.com/eslint/doctrine) | Apache-2.0 | [CQ22628](https://dev.eclipse.org/ipzilla/show_bug.cgi?id=22628) | | [`dom-accessibility-api@0.5.16`](https://github.com/eps1lon/dom-accessibility-api.git) | MIT | clearlydefined | +| [`dom-accessibility-api@0.6.3`](https://github.com/eps1lon/dom-accessibility-api.git) | MIT | clearlydefined | | [`dom-converter@0.2.0`](https://github.com/AriaMinaei/dom-converter) | MIT | clearlydefined | | [`dom-serializer@1.4.1`](git://github.com/cheeriojs/dom-renderer.git) | MIT | clearlydefined | | `domexception@4.0.0` | MIT | clearlydefined | @@ -862,7 +857,7 @@ | [`prettier-linter-helpers@1.0.0`](git+https://github.com/prettier/prettier-linter-helpers.git) | MIT | clearlydefined | | [`prettier@3.2.5`](https://prettier.io) | MIT | #13320 | | [`pretty-error@4.0.0`](https://github.com/AriaMinaei/pretty-error.git) | MIT | clearlydefined | -| [`pretty-format@26.6.2`](https://github.com/facebook/jest.git) | MIT | clearlydefined | +| [`pretty-format@27.5.1`](https://github.com/facebook/jest.git) | MIT | #1948 | | [`pretty-format@29.4.3`](https://github.com/facebook/jest.git) | MIT | clearlydefined | | [`pretty-format@29.7.0`](https://github.com/jestjs/jest.git) | MIT | clearlydefined | | [`proc-log@2.0.1`](https://github.com/npm/proc-log.git) | ISC | clearlydefined | @@ -882,7 +877,9 @@ | `quick-lru@4.0.1` | MIT | clearlydefined | | `quick-lru@5.1.1` | MIT | clearlydefined | | [`react-is@18.2.0`](https://github.com/facebook/react.git) | MIT | clearlydefined | -| [`react-test-renderer@16.14.0`](git+https://github.com/facebook/react.git) | MIT | clearlydefined | +| [`react-is@18.3.1`](https://github.com/facebook/react.git) | MIT | clearlydefined | +| [`react-shallow-renderer@16.15.0`](https://reactjs.org/) | MIT | clearlydefined | +| [`react-test-renderer@18.3.1`](https://github.com/facebook/react.git) | MIT | #14587 | | [`read-cmd-shim@3.0.0`](https://github.com/npm/read-cmd-shim.git) | ISC | clearlydefined | | [`read-cmd-shim@4.0.0`](https://github.com/npm/read-cmd-shim.git) | ISC | clearlydefined | | [`read-package-json-fast@2.0.3`](git+https://github.com/npm/read-package-json-fast.git) | ISC | clearlydefined | diff --git a/.deps/prod.md b/.deps/prod.md index 332571e59..ba86e1968 100644 --- a/.deps/prod.md +++ b/.deps/prod.md @@ -362,7 +362,7 @@ | [`randombytes@2.1.0`](git@github.com:crypto-browserify/randombytes.git) | MIT | clearlydefined | | [`randomfill@1.0.4`](https://github.com/crypto-browserify/randomfill.git) | MIT | clearlydefined | | [`react-copy-to-clipboard@5.1.0`](https://github.com/nkbt/react-copy-to-clipboard.git) | MIT | clearlydefined | -| [`react-dom@16.14.0`](git+https://github.com/facebook/react.git) | MIT | clearlydefined | +| [`react-dom@18.3.1`](https://github.com/facebook/react.git) | MIT | clearlydefined | | [`react-dropzone@9.0.0`](https://github.com/react-dropzone/react-dropzone.git) | MIT | [CQ22355](https://dev.eclipse.org/ipzilla/show_bug.cgi?id=22355) | | [`react-fast-compare@3.2.2`](https://github.com/FormidableLabs/react-fast-compare) | MIT | clearlydefined | | [`react-helmet@6.1.0`](https://github.com/nfl/react-helmet) | MIT | clearlydefined | @@ -374,7 +374,7 @@ | [`react-router@5.3.4`](https://github.com/remix-run/react-router.git) | MIT | #3024 | | [`react-side-effect@2.1.2`](https://github.com/gaearon/react-side-effect.git) | MIT | clearlydefined | | [`react-tooltip@4.5.1`](https://github.com/ReactTooltip/react-tooltip#readme) | MIT | #5006 | -| [`react@16.14.0`](git+https://github.com/facebook/react.git) | MIT | clearlydefined | +| [`react@18.3.1`](https://github.com/facebook/react.git) | MIT | clearlydefined | | [`readable-stream@3.6.2`](git://github.com/nodejs/readable-stream) | MIT | [CQ22627](https://dev.eclipse.org/ipzilla/show_bug.cgi?id=22627) | | [`readable-stream@4.4.2`](git://github.com/nodejs/readable-stream) | MIT | #8426 | | [`real-require@0.2.0`](git+https://github.com/pinojs/real-require.git) | MIT | [clearlydefined](https://clearlydefined.io/definitions/npm/npmjs/-/real-require/0.2.0) | @@ -402,7 +402,7 @@ | [`safe-stable-stringify@2.4.3`](git+https://github.com/BridgeAR/safe-stable-stringify.git) | MIT | clearlydefined | | [`safer-buffer@2.1.2`](git+https://github.com/ChALkeR/safer-buffer.git) | MIT | clearlydefined | | [`sanitize-html@2.13.0`](https://github.com/apostrophecms/sanitize-html.git) | MIT | clearlydefined | -| [`scheduler@0.19.1`](https://github.com/facebook/react.git) | MIT | clearlydefined | +| [`scheduler@0.23.2`](https://github.com/facebook/react.git) | MIT | #14588 | | [`seamless-immutable@7.1.4`](https://github.com/rtfeldman/seamless-immutable.git) | BSD-3-Clause | clearlydefined | | [`secure-json-parse@2.7.0`](git+https://github.com/fastify/secure-json-parse.git) | BSD-3-Clause | clearlydefined | | [`semver@7.5.4`](https://github.com/npm/node-semver.git) | ISC | clearlydefined | diff --git a/lerna.json b/lerna.json index 129064cf4..c6acd1d82 100644 --- a/lerna.json +++ b/lerna.json @@ -4,5 +4,6 @@ ], "npmClient": "yarn", "stream": true, - "version": "7.92.0-next" + "version": "7.92.0-next", + "useWorkspaces": true } diff --git a/package.json b/package.json index 1c5720242..5f7d360ec 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "scripts": { "build": "yarn prebuild && lerna run build --scope=@eclipse-che/dashboard-\\* --concurrency 1", "build:dev": "yarn prebuild && lerna run build:dev --scope=@eclipse-che/dashboard-\\*", - "prebuild": "yarn workspace @eclipse-che/common build", + "prebuild": "lerna run build --scope=@eclipse-che/common", "prebuild:dev": "yarn prebuild", "frontend:start": "yarn workspace @eclipse-che/dashboard-frontend start", "start": "${PWD}/run/local-run.sh $@", diff --git a/packages/dashboard-frontend/package.json b/packages/dashboard-frontend/package.json index 2d5ccb94f..3d0aa5a5f 100644 --- a/packages/dashboard-frontend/package.json +++ b/packages/dashboard-frontend/package.json @@ -52,9 +52,9 @@ "multi-ini": "^2.3.2", "process": "^0.11.10", "qs": "^6.12.1", - "react": "^16.14.0", + "react": "^18.3.1", "react-copy-to-clipboard": "^5.1.0", - "react-dom": "^16.12.0", + "react-dom": "^18.3.1", "react-helmet": "^6.1.0", "react-pluralize": "^1.6.3", "react-redux": "^7.2.9", @@ -74,10 +74,10 @@ "@eclipse-che/api": "^7.86.0", "@kubernetes/client-node": "^0.21.0", "@react-mock/state": "^0.1.8", - "@testing-library/dom": "^7.30.3", - "@testing-library/jest-dom": "6.1.4", - "@testing-library/react": "^10.3.0", - "@testing-library/user-event": "^12.1", + "@testing-library/dom": "^10.4.0", + "@testing-library/jest-dom": "^6.5.0", + "@testing-library/react": "^16.0.1", + "@testing-library/user-event": "^14.5.2", "@types/history": "^4.7.6", "@types/jest": "^29.5.3", "@types/js-yaml": "^4.0.5", @@ -85,10 +85,9 @@ "@types/qs": "^6.9.7", "@types/react-copy-to-clipboard": "^4.3.0", "@types/react-router-dom": "^5.3.3", - "@types/react-test-renderer": "^18.0.0", + "@types/react-test-renderer": "^18.3.0", "@types/redux-mock-store": "^1.0.2", "@types/sanitize-html": "^2.9.0", - "@types/testing-library__jest-dom": "^5.14.9", "@types/webpack": "^5.28.5", "@typescript-eslint/eslint-plugin": "^6.4.0", "@typescript-eslint/parser": "^6.4.0", @@ -115,7 +114,7 @@ "loader-utils": "^3.2.1", "mini-css-extract-plugin": "^2.7.6", "prettier": "^3.2.5", - "react-test-renderer": "^16.14.0", + "react-test-renderer": "^18.3.1", "redux-mock-store": "^1.5.4", "source-map-loader": "^4.0.1", "speed-measure-webpack-plugin": "^1.5.0", diff --git a/packages/dashboard-frontend/src/Layout/ErrorBoundary/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/Layout/ErrorBoundary/__tests__/index.spec.tsx index 9491ab0a1..125cc88e4 100644 --- a/packages/dashboard-frontend/src/Layout/ErrorBoundary/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/Layout/ErrorBoundary/__tests__/index.spec.tsx @@ -10,8 +10,8 @@ * Red Hat, Inc. - initial API and implementation */ -import { render, screen } from '@testing-library/react'; -import userEvent from '@testing-library/user-event'; +import { render, screen, waitFor } from '@testing-library/react'; +import userEvent, { UserEvent } from '@testing-library/user-event'; import React from 'react'; import renderer from 'react-test-renderer'; @@ -61,32 +61,37 @@ describe('Error boundary', () => { }); describe('error details', () => { - it('should show and hide the error stack', () => { + it('should show and hide the error stack', async () => { const errorBoundary = wrapComponent(); render(errorBoundary); const showDetailsAction = screen.getByRole('button', { name: 'View stack' }); - userEvent.click(showDetailsAction); + await userEvent.click(showDetailsAction); expect(mockOnError).not.toHaveBeenCalled(); - expect(screen.queryByText('in BadComponent', { exact: false })).toBeTruthy(); - expect(screen.queryByText('in ErrorBoundary', { exact: false })).toBeTruthy(); + await waitFor(() => + expect(screen.getByText('at BadComponent', { exact: false })).toBeTruthy(), + ); + expect(screen.queryByText('at ErrorBoundary', { exact: false })).toBeTruthy(); - userEvent.click(showDetailsAction); + await userEvent.click(showDetailsAction); - expect(screen.queryByText('in BadComponent', { exact: false })).toBeFalsy(); - expect(screen.queryByText('in ErrorBoundary', { exact: false })).toBeFalsy(); + expect(screen.queryByText('at BadComponent', { exact: false })).toBeFalsy(); + expect(screen.queryByText('at ErrorBoundary', { exact: false })).toBeFalsy(); }); }); describe('when some resources are absent', () => { const { reload } = window.location; + let user: UserEvent; beforeEach(() => { delete (window as any).location; (window.location as any) = { reload: jest.fn() }; jest.useFakeTimers(); + + user = userEvent.setup({ advanceTimers: jest.advanceTimersByTime }); }); afterEach(() => { @@ -109,9 +114,7 @@ describe('Error boundary', () => { ).toBeTruthy(); }); - it('should provide the countdown to the next page reload', () => { - jest.useFakeTimers(); - + it('should provide the countdown to the next page reload', async () => { const errorBoundary = wrapComponent(); render(errorBoundary); @@ -121,16 +124,16 @@ describe('Error boundary', () => { ).toBeTruthy(); expect(screen.queryByText('30 seconds', { exact: false })).toBeTruthy(); - jest.advanceTimersByTime(5000); + await jest.advanceTimersByTimeAsync(5000); expect(screen.queryByText('25 seconds', { exact: false })).toBeTruthy(); }); - it('should hide the countdown when stopped', () => { + it('should hide the countdown when stopped', async () => { const errorBoundary = wrapComponent(); render(errorBoundary); const stopCountdownAction = screen.getByRole('button', { name: 'Stop countdown' }); - userEvent.click(stopCountdownAction); + await user.click(stopCountdownAction); expect(mockOnError).toHaveBeenCalledWith('Loading chunk 23 failed.'); expect( @@ -138,48 +141,48 @@ describe('Error boundary', () => { ).toBeFalsy(); }); - it('should not reload page when countdown is stopped', () => { + it('should not reload page when countdown is stopped', async () => { const errorBoundary = wrapComponent(); render(errorBoundary); const stopCountdownAction = screen.getByRole('button', { name: 'Stop countdown' }); - userEvent.click(stopCountdownAction); + await user.click(stopCountdownAction); jest.advanceTimersByTime(35000); }); - it('should reload the page when countdown ends', () => { + it('should reload the page when countdown ends', async () => { const errorBoundary = wrapComponent(); render(errorBoundary); - jest.advanceTimersByTime(35000); + await jest.advanceTimersByTimeAsync(35000); expect(mockOnError).toHaveBeenCalledWith('Loading chunk 23 failed.'); expect(window.location.reload).toHaveBeenCalled(); expect(window.location.reload).toHaveBeenCalledTimes(1); }); - it('should reload the page by action', () => { + it('should reload the page by action', async () => { const errorBoundary = wrapComponent(); render(errorBoundary); const reloadNowAction = screen.getByRole('button', { name: 'Reload now' }); - userEvent.click(reloadNowAction); - userEvent.click(reloadNowAction); - userEvent.click(reloadNowAction); + await user.click(reloadNowAction); + await user.click(reloadNowAction); + await user.click(reloadNowAction); expect(mockOnError).toHaveBeenCalledWith('Loading chunk 23 failed.'); expect(window.location.reload).toHaveBeenCalled(); expect(window.location.reload).toHaveBeenCalledTimes(3); }); - it('should show additional message after a few reloads', () => { + it('should show additional message after a few reloads', async () => { const errorBoundary = wrapComponent(); render(errorBoundary); const reloadNowAction = screen.getByRole('button', { name: 'Reload now' }); - userEvent.click(reloadNowAction); + await user.click(reloadNowAction); // jest doesn't trigger the `window.onbeforeunload` // so it has to be done manually: @@ -187,7 +190,7 @@ describe('Error boundary', () => { window.dispatchEvent(new Event('beforeunload')); render(errorBoundary); - userEvent.click(reloadNowAction); + await user.click(reloadNowAction); // "refreshing" the page window.dispatchEvent(new Event('beforeunload')); @@ -202,13 +205,13 @@ describe('Error boundary', () => { ).toBeTruthy(); }); - it('should reset the number of reloads', () => { + it('should reset the number of reloads', async () => { const noResourceComponent = wrapComponent(); render(noResourceComponent); const reloadNowAction = screen.getByRole('button', { name: 'Reload now' }); - userEvent.click(reloadNowAction); + await user.click(reloadNowAction); // jest doesn't trigger the `window.onbeforeunload` // so it has to be done manually: @@ -216,7 +219,7 @@ describe('Error boundary', () => { window.dispatchEvent(new Event('beforeunload')); render(noResourceComponent); - userEvent.click(reloadNowAction); + await user.click(reloadNowAction); // "refreshing" the page window.dispatchEvent(new Event('beforeunload')); diff --git a/packages/dashboard-frontend/src/Layout/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/Layout/__tests__/index.spec.tsx index 5c70c605b..1ecaf9c38 100644 --- a/packages/dashboard-frontend/src/Layout/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/Layout/__tests__/index.spec.tsx @@ -79,32 +79,32 @@ describe('Layout component', () => { expect(snapshot).toMatchSnapshot(); }); - test('logout', () => { + test('logout', async () => { renderComponent(store); const logoutButton = screen.getByRole('button', { name: 'logout' }); - userEvent.click(logoutButton); + await userEvent.click(logoutButton); expect(mockLogout).toHaveBeenCalledTimes(1); }); - test('toggleNav', () => { + test('toggleNav', async () => { renderComponent(store); expect(screen.getByTestId('isNavOpen')).toHaveTextContent('true'); const toggleNavButton = screen.getByRole('button', { name: 'toggleNav' }); - userEvent.click(toggleNavButton); + await userEvent.click(toggleNavButton); expect(screen.getByTestId('isNavOpen')).toHaveTextContent('false'); }); - test('onError', () => { + test('onError', async () => { mockTestBackends.mockResolvedValue(undefined); renderComponent(store); const btn = screen.getByRole('button', { name: 'onError' }); - userEvent.click(btn); + await userEvent.click(btn); expect(mockTestBackends).toHaveBeenCalled(); }); diff --git a/packages/dashboard-frontend/src/Routes/index.tsx b/packages/dashboard-frontend/src/Routes/index.tsx index 6ed01d77d..d341f2fa4 100644 --- a/packages/dashboard-frontend/src/Routes/index.tsx +++ b/packages/dashboard-frontend/src/Routes/index.tsx @@ -50,7 +50,7 @@ function Routes(): React.ReactElement { {...routes} - + } /> ); } diff --git a/packages/dashboard-frontend/src/components/AppAlertGroup/__tests__/AppAlertGroup.spec.tsx b/packages/dashboard-frontend/src/components/AppAlertGroup/__tests__/AppAlertGroup.spec.tsx index f6408e95a..bba51474f 100644 --- a/packages/dashboard-frontend/src/components/AppAlertGroup/__tests__/AppAlertGroup.spec.tsx +++ b/packages/dashboard-frontend/src/components/AppAlertGroup/__tests__/AppAlertGroup.spec.tsx @@ -11,7 +11,7 @@ */ import { AlertVariant } from '@patternfly/react-core'; -import { fireEvent, render, RenderResult, screen } from '@testing-library/react'; +import { fireEvent, render, RenderResult, screen, waitFor } from '@testing-library/react'; import React from 'react'; import { container } from '@/inversify.config'; @@ -34,40 +34,41 @@ describe('AppAlertGroup component', () => { }; beforeEach(() => { + container.snapshot(); jest.useFakeTimers(); }); afterEach(() => { - jest.runOnlyPendingTimers(); + container.restore(); jest.useRealTimers(); }); - it('should show the alert and hide with a close button', () => { + it('should show the alert and hide with a close button', async () => { renderComponent(); const title = 'test 1 message'; showAlert(title); - expect(screen.queryAllByText(title).length).toEqual(1); + await waitFor(() => expect(screen.queryAllByText(title).length).toEqual(1)); const closeButton = screen.getByRole('button'); fireEvent.click(closeButton); - expect(screen.queryAllByText(title).length).toEqual(0); + await waitFor(() => expect(screen.queryAllByText(title).length).toEqual(0)); }); - it('should show the alert and hide after timeout', () => { + it('should show the alert and hide after timeout', async () => { renderComponent(); const title = 'test 2 message'; showAlert(title); - expect(screen.queryAllByText(title).length).toEqual(1); + await waitFor(() => expect(screen.queryAllByText(title).length).toEqual(1)); // Fast-forward until pending timers have been executed - jest.runAllTimers(); + await jest.runAllTimersAsync(); - expect(screen.queryAllByText(title).length).toEqual(0); + await waitFor(() => expect(screen.queryAllByText(title).length).toEqual(0)); }); }); diff --git a/packages/dashboard-frontend/src/components/EditorSelector/Definition/DefinitionField/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/components/EditorSelector/Definition/DefinitionField/__tests__/index.spec.tsx index e267991fd..89765519d 100644 --- a/packages/dashboard-frontend/src/components/EditorSelector/Definition/DefinitionField/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/components/EditorSelector/Definition/DefinitionField/__tests__/index.spec.tsx @@ -30,7 +30,7 @@ describe('EditorDefinitionField', () => { expect(snapshot.toJSON()).toMatchSnapshot(); }); - test('helper text, definition change', () => { + test('helper text, definition change', async () => { renderComponent(); const helperText = 'Default editor will be used if no definition is provided.'; @@ -40,12 +40,13 @@ describe('EditorDefinitionField', () => { const input = screen.getByRole('textbox'); const editorId = 'some/editor/id'; - userEvent.paste(input, editorId); + await userEvent.click(input); + await userEvent.paste(editorId); expect(mockOnChange).toHaveBeenNthCalledWith(1, editorId); expect(screen.queryByText(helperText)).toBeNull(); - userEvent.clear(input); + await userEvent.clear(input); expect(mockOnChange).toHaveBeenNthCalledWith(2, undefined); expect(screen.queryByText(helperText)).not.toBeNull(); diff --git a/packages/dashboard-frontend/src/components/EditorSelector/Definition/ImageField/__tests__/__snapshots__/index.spec.tsx.snap b/packages/dashboard-frontend/src/components/EditorSelector/Definition/ImageField/__tests__/__snapshots__/index.spec.tsx.snap index c82ab87ed..59dfe03af 100644 --- a/packages/dashboard-frontend/src/components/EditorSelector/Definition/ImageField/__tests__/__snapshots__/index.spec.tsx.snap +++ b/packages/dashboard-frontend/src/components/EditorSelector/Definition/ImageField/__tests__/__snapshots__/index.spec.tsx.snap @@ -37,7 +37,6 @@ exports[`EditorDefinitionField snapshot 1`] = ` type="text" value="" /> - `; diff --git a/packages/dashboard-frontend/src/components/EditorSelector/Definition/ImageField/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/components/EditorSelector/Definition/ImageField/__tests__/index.spec.tsx index c9642d01e..88fb1d54c 100644 --- a/packages/dashboard-frontend/src/components/EditorSelector/Definition/ImageField/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/components/EditorSelector/Definition/ImageField/__tests__/index.spec.tsx @@ -30,13 +30,14 @@ describe('EditorDefinitionField', () => { expect(snapshot.toJSON()).toMatchSnapshot(); }); - test('image change', () => { + test('image change', async () => { renderComponent(); const input = screen.getByRole('textbox'); const editorId = 'editor-image'; - userEvent.paste(input, editorId); + await userEvent.click(input); + await userEvent.paste(editorId); expect(mockOnChange).toHaveBeenNthCalledWith(1, editorId); diff --git a/packages/dashboard-frontend/src/components/EditorSelector/Definition/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/components/EditorSelector/Definition/__tests__/index.spec.tsx index 2b45b9118..242b7f04c 100644 --- a/packages/dashboard-frontend/src/components/EditorSelector/Definition/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/components/EditorSelector/Definition/__tests__/index.spec.tsx @@ -38,20 +38,20 @@ describe('EditorDefinition', () => { expect(snapshot.toJSON()).toMatchSnapshot(); }); - it('should handle editor definition change', () => { + it('should handle editor definition change', async () => { renderComponent(undefined, undefined); const definitionChangeButton = screen.getByRole('button', { name: 'Editor Definition Change' }); - userEvent.click(definitionChangeButton); + await userEvent.click(definitionChangeButton); expect(mockOnChange).toHaveBeenCalledWith('some/editor/id', undefined); }); - it('should handle editor image change', () => { + it('should handle editor image change', async () => { renderComponent(undefined, undefined); const imageChangeButton = screen.getByRole('button', { name: 'Editor Image Change' }); - userEvent.click(imageChangeButton); + await userEvent.click(imageChangeButton); expect(mockOnChange).toHaveBeenCalledWith(undefined, 'editor-image'); }); diff --git a/packages/dashboard-frontend/src/components/EditorSelector/Gallery/Entry/__tests__/__snapshots__/index.spec.tsx.snap b/packages/dashboard-frontend/src/components/EditorSelector/Gallery/Entry/__tests__/__snapshots__/index.spec.tsx.snap index e20856816..677992d57 100644 --- a/packages/dashboard-frontend/src/components/EditorSelector/Gallery/Entry/__tests__/__snapshots__/index.spec.tsx.snap +++ b/packages/dashboard-frontend/src/components/EditorSelector/Gallery/Entry/__tests__/__snapshots__/index.spec.tsx.snap @@ -34,7 +34,6 @@ exports[`Editor Selector Entry snapshot 1`] = `
-
    { }); describe('card actions', () => { - test('kebab click', () => { + test('kebab click', async () => { renderComponent(editorGroup[0].id, editorGroup); const kebab = screen.getByRole('button', { name: 'Actions' }); - kebab.click(); + await userEvent.click(kebab); expect(screen.getByRole('menu')).toBeInTheDocument(); @@ -133,7 +133,7 @@ describe('Editor Selector Entry', () => { isSelectedGroup: true, // card is selected }; - test('select same version', () => { + test('select same version', async () => { renderComponent(editorGroup[0].id, editorGroup, localState); const activeDropdownItem = screen.getByRole('menuitem', { @@ -142,20 +142,20 @@ describe('Editor Selector Entry', () => { expect(activeDropdownItem).toHaveAttribute('aria-checked', 'true'); - userEvent.click(activeDropdownItem); + await userEvent.click(activeDropdownItem); // should NOT call onSelect expect(mockOnSelect).not.toHaveBeenCalled(); }); - test('select different version', () => { + test('select different version', async () => { renderComponent(editorGroup[0].id, editorGroup, localState); const dropdownItem = screen.getByRole('menuitem', { name: editorGroup[1].version }); expect(dropdownItem).toHaveAttribute('aria-checked', 'false'); - userEvent.click(dropdownItem); + await userEvent.click(dropdownItem); // should call onSelect expect(mockOnSelect).toHaveBeenCalled(); @@ -169,7 +169,7 @@ describe('Editor Selector Entry', () => { isSelectedGroup: false, // card is not selected }; - test('select same version', () => { + test('select same version', async () => { renderComponent('other/editor/id', editorGroup, localState); const activeDropdownItem = screen.getByRole('menuitem', { @@ -178,39 +178,39 @@ describe('Editor Selector Entry', () => { expect(activeDropdownItem).toHaveAttribute('aria-checked', 'true'); - userEvent.click(activeDropdownItem); + await userEvent.click(activeDropdownItem); // should NOT call onSelect expect(mockOnSelect).not.toHaveBeenCalled(); }); - test('select different version', () => { + test('select different version', async () => { renderComponent('other/editor/id', editorGroup, localState); const dropdownItem = screen.getByRole('menuitem', { name: editorGroup[1].version }); expect(dropdownItem).toHaveAttribute('aria-checked', 'false'); - userEvent.click(dropdownItem); + await userEvent.click(dropdownItem); // should NOT call onSelect expect(mockOnSelect).not.toHaveBeenCalled(); }); - test('select different version and select the card', () => { + test('select different version and select the card', async () => { renderComponent('other/editor/id', editorGroup, localState); const dropdownItem = screen.getByRole('menuitem', { name: editorGroup[1].version }); expect(dropdownItem).toHaveAttribute('aria-checked', 'false'); - userEvent.click(dropdownItem); + await userEvent.click(dropdownItem); // should NOT call onSelect expect(mockOnSelect).not.toHaveBeenCalled(); const card = screen.getByRole('article'); - userEvent.click(card); + await userEvent.click(card); // should call onSelect expect(mockOnSelect).toHaveBeenCalledWith(editorGroup[1].id); diff --git a/packages/dashboard-frontend/src/components/EditorSelector/__tests__/__snapshots__/index.spec.tsx.snap b/packages/dashboard-frontend/src/components/EditorSelector/__tests__/__snapshots__/index.spec.tsx.snap index 2365fdee0..3c5977fad 100644 --- a/packages/dashboard-frontend/src/components/EditorSelector/__tests__/__snapshots__/index.spec.tsx.snap +++ b/packages/dashboard-frontend/src/components/EditorSelector/__tests__/__snapshots__/index.spec.tsx.snap @@ -201,9 +201,7 @@ exports[`Editor Selector snapshot 1`] = `
- -
+ /> - diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/RegistryPassword/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/RegistryPassword/__tests__/index.spec.tsx index 10b70205e..d89c1dc0b 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/RegistryPassword/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/RegistryPassword/__tests__/index.spec.tsx @@ -12,7 +12,7 @@ import { Form } from '@patternfly/react-core'; import { render, screen } from '@testing-library/react'; -import userEvent from '@testing-library/user-event'; +import userEvent, { UserEvent } from '@testing-library/user-event'; import React from 'react'; import renderer from 'react-test-renderer'; @@ -20,6 +20,7 @@ import { RegistryPasswordFormGroup } from '..'; describe('Registry Password Input', () => { const mockOnChange = jest.fn(); + let user: UserEvent; function getComponent(password: string): React.ReactElement { return ( @@ -29,6 +30,10 @@ describe('Registry Password Input', () => { ); } + beforeEach(() => { + user = userEvent.setup(); + }); + afterEach(() => { jest.clearAllMocks(); }); @@ -69,7 +74,7 @@ describe('Registry Password Input', () => { expect(input).toHaveValue('*testreg#'); }); - it('should fire onChange event', () => { + it('should fire onChange event', async () => { const component = getComponent('*te'); render(component); @@ -78,20 +83,20 @@ describe('Registry Password Input', () => { expect(input).toHaveValue('*te'); expect(mockOnChange).not.toHaveBeenCalled(); - userEvent.type(input, 'st'); + await user.type(input, 'st'); expect(mockOnChange).toHaveBeenCalledWith('*tes', 'success'); expect(mockOnChange).toHaveBeenCalledWith('*test', 'success'); }); describe('validation', () => { - it('should handle empty value', () => { + it('should handle empty value', async () => { const component = getComponent('https://testreg.com/test1'); render(component); const input = screen.getByTestId('registry-password-input'); - userEvent.clear(input); + await user.clear(input); const label = screen.queryByText('A value is required.'); @@ -99,7 +104,7 @@ describe('Registry Password Input', () => { expect(input).toBeInvalid(); }); - it('should handle maximum value length', () => { + it('should handle maximum value length', async () => { const component = getComponent('https://testreg.com/test1'); render(component); @@ -109,16 +114,20 @@ describe('Registry Password Input', () => { const allowedPassword = 'a'.repeat(10000); let label: HTMLElement | null; - userEvent.clear(input); - userEvent.type(input, allowedPassword); + await user.clear(input); + + await user.click(input); + await user.paste(allowedPassword); label = screen.queryByText(message); expect(label).toBeFalsy(); const disallowedPassword = 'a'.repeat(10001); - userEvent.clear(input); - userEvent.type(input, disallowedPassword); + await user.clear(input); + + await user.click(input); + await user.paste(disallowedPassword); label = screen.queryByText(message); expect(label).toBeTruthy(); diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/RegistryUrl/__tests__/__snapshots__/index.spec.tsx.snap b/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/RegistryUrl/__tests__/__snapshots__/index.spec.tsx.snap index c888b9253..31f5faab5 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/RegistryUrl/__tests__/__snapshots__/index.spec.tsx.snap +++ b/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/RegistryUrl/__tests__/__snapshots__/index.spec.tsx.snap @@ -101,7 +101,6 @@ exports[`Registry Url Input should correctly render the component 1`] = ` - diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/RegistryUrl/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/RegistryUrl/__tests__/index.spec.tsx index c15d124c4..3e0306b9e 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/RegistryUrl/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/RegistryUrl/__tests__/index.spec.tsx @@ -66,13 +66,13 @@ describe('Registry Url Input', () => { expect(input).toHaveValue('http://testreg.com'); }); - it('should fire onChange event', () => { + it('should fire onChange event', async () => { const component = getComponent('http://t'); render(component); const input = screen.getByRole('textbox'); - userEvent.type(input, 'est'); + await userEvent.type(input, 'est'); expect(mockOnChange).toHaveBeenCalledWith('http://te', 'success'); expect(mockOnChange).toHaveBeenCalledWith('http://tes', 'success'); @@ -80,13 +80,13 @@ describe('Registry Url Input', () => { }); describe('validation', () => { - it('should handle empty value', () => { + it('should handle empty value', async () => { const component = getComponent('https://testreg.com/test1'); render(component); const input = screen.getByRole('textbox'); - userEvent.clear(input); + await userEvent.clear(input); const label = screen.queryByText('A value is required.'); @@ -94,7 +94,7 @@ describe('Registry Url Input', () => { expect(input).toBeInvalid(); }); - it('should handle maximum value length', () => { + it('should handle maximum value length', async () => { const component = getComponent('https://testreg.com/test1'); render(component); @@ -104,16 +104,16 @@ describe('Registry Url Input', () => { const allowedUrl = 'a'.repeat(256); let label: HTMLElement | null; - userEvent.clear(input); - userEvent.type(input, allowedUrl); + await userEvent.clear(input); + await userEvent.type(input, allowedUrl); label = screen.queryByText(message); expect(label).toBeFalsy(); const disallowedUrl = 'a'.repeat(257); - userEvent.clear(input); - userEvent.type(input, disallowedUrl); + await userEvent.clear(input); + await userEvent.type(input, disallowedUrl); label = screen.queryByText(message); expect(label).toBeTruthy(); diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/RegistryUsername/__tests__/__snapshots__/index.spec.tsx.snap b/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/RegistryUsername/__tests__/__snapshots__/index.spec.tsx.snap index bce4abe69..9e8acf93d 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/RegistryUsername/__tests__/__snapshots__/index.spec.tsx.snap +++ b/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/RegistryUsername/__tests__/__snapshots__/index.spec.tsx.snap @@ -48,7 +48,6 @@ exports[`Registry Username Input should correctly render the component 1`] = ` type="text" value="Attt" /> - diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/RegistryUsername/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/RegistryUsername/__tests__/index.spec.tsx index c59654450..0be85c940 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/RegistryUsername/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/RegistryUsername/__tests__/index.spec.tsx @@ -64,20 +64,20 @@ describe('Registry Username Input', () => { expect(input).toHaveValue('Atestregn'); }); - it('should fire onChange event', () => { + it('should fire onChange event', async () => { const component = getComponent('Ate'); render(component); const input = screen.getByRole('textbox'); - userEvent.type(input, 'st'); + await userEvent.type(input, 'st'); expect(mockOnChange).toHaveBeenCalledWith('Ates', 'success'); expect(mockOnChange).toHaveBeenCalledWith('Atest', 'success'); }); describe('validation', () => { - it('should handle maximum value length', () => { + it('should handle maximum value length', async () => { const component = getComponent('https://testreg.com/test1'); render(component); @@ -87,16 +87,16 @@ describe('Registry Username Input', () => { const allowedUsername = 'a'.repeat(100); let label: HTMLElement | null; - userEvent.clear(input); - userEvent.type(input, allowedUsername); + await userEvent.clear(input); + await userEvent.type(input, allowedUsername); label = screen.queryByText(message); expect(label).toBeFalsy(); const disallowedUsername = 'a'.repeat(101); - userEvent.clear(input); - userEvent.type(input, disallowedUsername); + await userEvent.clear(input); + await userEvent.type(input, disallowedUsername); label = screen.queryByText(message); expect(label).toBeTruthy(); diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/__tests__/__snapshots__/index.spec.tsx.snap b/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/__tests__/__snapshots__/index.spec.tsx.snap index d2d6f6bd2..5b4db1513 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/__tests__/__snapshots__/index.spec.tsx.snap +++ b/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/__tests__/__snapshots__/index.spec.tsx.snap @@ -4,9 +4,7 @@ exports[`ContainerRegistries should correctly render the component which contain [ - - , + />,
@@ -137,7 +135,6 @@ exports[`ContainerRegistries should correctly render the component which contain type="checkbox" /> - - - + /> - - , + />,
diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/__tests__/index.spec.tsx index c78df8dca..1d6c72138 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/ContainerRegistriesTab/__tests__/index.spec.tsx @@ -78,25 +78,25 @@ describe('ContainerRegistries', () => { expect(json).toMatchSnapshot(); }); - it('should add a new registry', () => { + it('should add a new registry', async () => { const component = getComponent(new FakeStoreBuilder().build()); render(component); const addRegistryButton = screen.getByLabelText('add-registry'); - userEvent.click(addRegistryButton); + await userEvent.click(addRegistryButton); const editButton = screen.getByTestId('edit-button'); expect(editButton).toBeDisabled(); const urlInput = screen.getByLabelText('Url input'); - userEvent.type(urlInput, 'http://tst'); + await userEvent.type(urlInput, 'http://tst'); const passwordInput = screen.getByTestId('registry-password-input'); - userEvent.type(passwordInput, 'qwe'); + await userEvent.type(passwordInput, 'qwe'); expect(editButton).toBeEnabled(); - userEvent.click(editButton); + await userEvent.click(editButton); expect(mockUpdateCredentials).toHaveBeenCalledWith([ { url: 'http://tst', @@ -106,7 +106,7 @@ describe('ContainerRegistries', () => { ]); }); - it('should delete a registry', () => { + it('should delete a registry', async () => { const component = getComponent( new FakeStoreBuilder() .withDockerConfig([ @@ -117,10 +117,10 @@ describe('ContainerRegistries', () => { render(component); const menuButton = screen.getByLabelText('Actions'); - userEvent.click(menuButton); + await userEvent.click(menuButton); const deleteItem = screen.getByRole('menuitem', { name: /Delete registry/i }); - userEvent.click(deleteItem); + await userEvent.click(deleteItem); const label = screen.queryByText("Would you like to delete registry 'http://test.reg'?"); expect(label).toBeTruthy(); @@ -129,10 +129,10 @@ describe('ContainerRegistries', () => { expect(deleteButton).toBeDisabled(); const checkbox = screen.getByTestId('warning-info-checkbox'); - userEvent.click(checkbox); + await userEvent.click(checkbox); expect(deleteButton).toBeEnabled(); - userEvent.click(deleteButton); + await userEvent.click(deleteButton); expect(mockUpdateCredentials).toHaveBeenCalledWith([]); }); }); diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/AddModal/GitConfigForm/__tests__/__snapshots__/index.spec.tsx.snap b/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/AddModal/GitConfigForm/__tests__/__snapshots__/index.spec.tsx.snap index daccc75ae..031ce95db 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/AddModal/GitConfigForm/__tests__/__snapshots__/index.spec.tsx.snap +++ b/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/AddModal/GitConfigForm/__tests__/__snapshots__/index.spec.tsx.snap @@ -43,7 +43,6 @@ exports[`GitConfigForm snapshot with predefined git configuration 1`] = ` type="button" /> - @@ -88,7 +87,6 @@ exports[`GitConfigForm snapshot without predefined git configuration 1`] = ` type="button" /> - diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/AddModal/GitConfigForm/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/AddModal/GitConfigForm/__tests__/index.spec.tsx index 95654171b..b9b2ddd47 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/AddModal/GitConfigForm/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/AddModal/GitConfigForm/__tests__/index.spec.tsx @@ -38,11 +38,11 @@ describe('GitConfigForm', () => { expect(snapshot.toJSON()).toMatchSnapshot(); }); - it('should handle a valid value', () => { + it('should handle a valid value', async () => { renderComponent(); const gitConfigField = screen.getByTestId('submit-valid-git-config'); - userEvent.click(gitConfigField); + await userEvent.click(gitConfigField); expect(mockOnChange).toHaveBeenCalledWith( { user: { email: 'user-1@chetest.com', name: 'User One' } }, @@ -50,11 +50,11 @@ describe('GitConfigForm', () => { ); }); - it('should handle an invalid value', () => { + it('should handle an invalid value', async () => { renderComponent(); const gitConfigField = screen.getByTestId('submit-invalid-git-config'); - userEvent.click(gitConfigField); + await userEvent.click(gitConfigField); expect(mockOnChange).toHaveBeenCalledWith({ user: { name: 'User One' } }, false); }); diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/AddModal/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/AddModal/__tests__/index.spec.tsx index 8f5b698bb..770ff4926 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/AddModal/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/AddModal/__tests__/index.spec.tsx @@ -43,23 +43,23 @@ describe('AddModal', () => { expect(screen.queryByRole('dialog')).toBeTruthy(); }); - it('should handle click on Close button', () => { + it('should handle click on Close button', async () => { renderComponent(true); const closeButton = screen.queryByRole('button', { name: 'Close' }); expect(closeButton).toBeTruthy(); - userEvent.click(closeButton!); + await userEvent.click(closeButton!); expect(mockOnClose).toHaveBeenCalledTimes(1); }); - it('should handle click on Cancel button', () => { + it('should handle click on Cancel button', async () => { renderComponent(true); const cancelButton = screen.queryByRole('button', { name: 'Cancel' }); expect(cancelButton).toBeTruthy(); - userEvent.click(cancelButton!); + await userEvent.click(cancelButton!); expect(mockOnClose).toHaveBeenCalledTimes(1); }); @@ -95,7 +95,7 @@ describe('AddModal', () => { describe('should handle saving git configuration', () => { const isOpen = true; - it('should handle valid git configuration', () => { + it('should handle valid git configuration', async () => { renderComponent(isOpen); // expect add button to be disabled @@ -103,18 +103,18 @@ describe('AddModal', () => { expect(addButton).toBeDisabled(); const SubmitValidFormButton = screen.getByTestId('submit-valid-git-config'); - userEvent.click(SubmitValidFormButton); + await userEvent.click(SubmitValidFormButton); // expect add button to be enabled expect(addButton).toBeEnabled(); - userEvent.click(addButton); + await userEvent.click(addButton); // expect onSave to be called expect(mockOnSave).toHaveBeenCalledTimes(1); }); - it('should handle invalid git configuration', () => { + it('should handle invalid git configuration', async () => { renderComponent(isOpen); // expect add button to be enabled @@ -122,7 +122,7 @@ describe('AddModal', () => { expect(addButton).toBeDisabled(); const SubmitInvalidFormButton = screen.getByTestId('submit-invalid-git-config'); - userEvent.click(SubmitInvalidFormButton); + await userEvent.click(SubmitInvalidFormButton); // expect add button to be disabled expect(addButton).toBeDisabled(); diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/Form/SectionUser/Email/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/Form/SectionUser/Email/__tests__/index.spec.tsx index 87d1e5918..b363b89e7 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/Form/SectionUser/Email/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/Form/SectionUser/Email/__tests__/index.spec.tsx @@ -38,29 +38,31 @@ describe('GitConfigUserEmail', () => { expect(snapshot.toJSON()).toMatchSnapshot(); }); - it('should fail validation if value is empty', () => { + it('should fail validation if value is empty', async () => { renderComponent('user@che.org', false); const textInput = screen.getByRole('textbox'); - userEvent.clear(textInput); + await userEvent.clear(textInput); expect(screen.getByTestId('validated')).toHaveTextContent(ValidatedOptions.error); }); - it('should fail validation if value is too long', () => { + it('should fail validation if value is too long', async () => { renderComponent('user@che.org', false); const textInput = screen.getByRole('textbox'); - userEvent.paste(textInput, 'a'.repeat(129)); + await userEvent.click(textInput); + await userEvent.paste('a'.repeat(129)); expect(screen.getByTestId('validated')).toHaveTextContent(ValidatedOptions.error); }); - it('should fail validation if is not a valid email', () => { + it('should fail validation if is not a valid email', async () => { renderComponent('user@che.org', false); const textInput = screen.getByRole('textbox'); - userEvent.paste(textInput, '@test'); + await userEvent.click(textInput); + await userEvent.paste('@test'); expect(screen.getByTestId('validated')).toHaveTextContent(ValidatedOptions.error); }); @@ -75,11 +77,12 @@ describe('GitConfigUserEmail', () => { expect(screen.getByTestId('validated')).toHaveTextContent(ValidatedOptions.default); }); - it('should handle value changing', () => { + it('should handle value changing', async () => { renderComponent('user@che.org', false); const textInput = screen.getByRole('textbox'); - userEvent.paste(textInput, 'a'); + await userEvent.click(textInput); + await userEvent.paste('a'); expect(mockOnChange).toHaveBeenCalledWith('user@che.orga', true); }); diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/Form/SectionUser/Name/__tests__/__snapshots__/index.spec.tsx.snap b/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/Form/SectionUser/Name/__tests__/__snapshots__/index.spec.tsx.snap index 9fd6d9abe..0cf63ad95 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/Form/SectionUser/Name/__tests__/__snapshots__/index.spec.tsx.snap +++ b/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/Form/SectionUser/Name/__tests__/__snapshots__/index.spec.tsx.snap @@ -64,7 +64,6 @@ exports[`GitConfigUserName snapshot, loading 1`] = ` type="button" /> - `; @@ -133,7 +132,6 @@ exports[`GitConfigUserName snapshot, not loading 1`] = ` type="button" /> - `; diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/Form/SectionUser/Name/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/Form/SectionUser/Name/__tests__/index.spec.tsx index 095a44042..869f3101f 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/Form/SectionUser/Name/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/Form/SectionUser/Name/__tests__/index.spec.tsx @@ -39,11 +39,11 @@ describe('GitConfigUserName', () => { expect(snapshot.toJSON()).toMatchSnapshot(); }); - it('should fail validation if value is empty', () => { + it('should fail validation if value is empty', async () => { renderComponent('user one', false); const textInput = screen.getByRole('textbox'); - userEvent.clear(textInput); + await userEvent.clear(textInput); expect(screen.getByTestId('validated')).toHaveTextContent(ValidatedOptions.error); }); @@ -52,7 +52,8 @@ describe('GitConfigUserName', () => { renderComponent('user one', false); const textInput = screen.getByRole('textbox'); - userEvent.paste(textInput, 'a'.repeat(129)); + await userEvent.click(textInput); + await userEvent.paste('a'.repeat(129)); expect(screen.getByTestId('validated')).toHaveTextContent(ValidatedOptions.error); }); @@ -67,11 +68,12 @@ describe('GitConfigUserName', () => { expect(screen.getByTestId('validated')).toHaveTextContent(ValidatedOptions.default); }); - it('should handle value changing', () => { + it('should handle value changing', async () => { renderComponent('user one', false); const textInput = screen.getByRole('textbox'); - userEvent.paste(textInput, ' two'); + await userEvent.click(textInput); + await userEvent.paste(' two'); expect(mockOnChange).toHaveBeenCalledWith('user one two', true); }); diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/Form/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/Form/__tests__/index.spec.tsx index 400b66852..a383a1e4f 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/Form/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/Form/__tests__/index.spec.tsx @@ -11,6 +11,7 @@ */ import { StateMock } from '@react-mock/state'; +import userEvent from '@testing-library/user-event'; import React from 'react'; import getComponentRenderer, { screen, waitFor } from '@/services/__mocks__/getComponentRenderer'; @@ -81,14 +82,15 @@ describe('GitConfigForm', () => { expect(screen.getByRole('button', { name: 'Reload' })).toBeEnabled(); }); - test('handle valid changes', () => { + test('handle valid changes', async () => { renderComponent(); // state with no changes expect(screen.getByRole('button', { name: 'Save' })).toBeDisabled(); expect(screen.getByRole('button', { name: 'Reload' })).toBeEnabled(); - screen.getByRole('button', { name: 'Change Email Valid' }).click(); + const changeEmailButton = screen.getByRole('button', { name: 'Change Email Valid' }); + await userEvent.click(changeEmailButton); // state with valid changes expect(screen.getByRole('button', { name: 'Save' })).toBeEnabled(); @@ -105,7 +107,8 @@ describe('GitConfigForm', () => { // expect the name to be changed expect(screen.getByTestId('user-name')).toHaveTextContent('new name'); - screen.getByRole('button', { name: 'Reload' }).click(); + const reloadButton = screen.getByRole('button', { name: 'Reload' }); + await userEvent.click(reloadButton); expect(mockOnReload).toHaveBeenCalled(); diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/GitConfigImport/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/GitConfigImport/__tests__/index.spec.tsx index 0d36c5ddd..e99fb651c 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/GitConfigImport/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/GitConfigImport/__tests__/index.spec.tsx @@ -20,7 +20,11 @@ import { GitConfigImport, textAreaPlaceholder, } from '@/pages/UserPreferences/GitConfig/GitConfigImport'; -import getComponentRenderer, { screen, waitFor } from '@/services/__mocks__/getComponentRenderer'; +import getComponentRenderer, { + fireEvent, + screen, + waitFor, +} from '@/services/__mocks__/getComponentRenderer'; const { renderComponent, createSnapshot } = getComponentRenderer(getComponent); @@ -94,7 +98,9 @@ describe('GitConfigUpload', () => { const fileUploader = screen.getByTestId(fieldId); const fileUploadInput = fileUploader.querySelector('input[type="file"]'); - userEvent.upload(fileUploadInput!, file); + // `userEvent` does not accept `Element` as a parameter + // use `fireEvent` instead + fireEvent.change(fileUploadInput!, { target: { files: [file] } }); await waitFor(() => expect(mockOnChange).toHaveBeenCalledWith(fileContent, true)); @@ -103,7 +109,7 @@ describe('GitConfigUpload', () => { /* Clear the field */ - userEvent.click(clearButton); + await userEvent.click(clearButton); expect(fileInput).toHaveValue(''); expect(clearButton).toBeDisabled(); @@ -123,7 +129,8 @@ describe('GitConfigUpload', () => { /* Paste a content */ const content = 'content'; - userEvent.paste(contentInput, content); + await userEvent.click(contentInput); + await userEvent.paste(content); await waitFor(() => expect(mockOnChange).toHaveBeenCalledWith(content, false)); @@ -134,7 +141,7 @@ describe('GitConfigUpload', () => { /* Clear the field */ - userEvent.click(clearButton); + await userEvent.click(clearButton); expect(contentInput).toHaveValue(''); expect(clearButton).toBeDisabled(); diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/__tests__/__snapshots__/index.spec.tsx.snap b/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/__tests__/__snapshots__/index.spec.tsx.snap index 2ea99e502..a5d5f66d5 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/__tests__/__snapshots__/index.spec.tsx.snap +++ b/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/__tests__/__snapshots__/index.spec.tsx.snap @@ -4,9 +4,7 @@ exports[`GitConfig snapshot with gitconfig 1`] = ` [ - - , + />,
@@ -117,9 +115,7 @@ exports[`GitConfig snapshot with no gitconfig 1`] = ` [ - - , + />,
diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/__tests__/index.spec.tsx index ee2cbb134..9e763b2ab 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/GitConfig/__tests__/index.spec.tsx @@ -130,7 +130,7 @@ describe('GitConfig', () => { renderComponent(store); const saveConfigButton = screen.getByRole('button', { name: 'Save Config' }); - userEvent.click(saveConfigButton); + await userEvent.click(saveConfigButton); // mock should be called expect(mockUpdateGitConfig).toHaveBeenCalled(); @@ -151,7 +151,7 @@ describe('GitConfig', () => { mockUpdateGitConfig.mockRejectedValueOnce(new Error('update gitconfig error')); const saveConfigButton = screen.getByRole('button', { name: 'Save Config' }); - userEvent.click(saveConfigButton); + await userEvent.click(saveConfigButton); // mock should be called expect(mockUpdateGitConfig).toHaveBeenCalled(); @@ -188,7 +188,7 @@ describe('GitConfig', () => { renderComponent(store); const reloadConfigButton = screen.getByRole('button', { name: 'Reload Config' }); - userEvent.click(reloadConfigButton); + await userEvent.click(reloadConfigButton); // mock should be called expect(mockRequestGitConfig).toHaveBeenCalled(); diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/GitServices/List/Tooltip/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/GitServices/List/Tooltip/__tests__/index.spec.tsx index d277938e8..74a280209 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/GitServices/List/Tooltip/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/GitServices/List/Tooltip/__tests__/index.spec.tsx @@ -43,7 +43,7 @@ describe('ProviderWarning', () => { renderComponent(true); const link = screen.getByTestId('tooltip-link'); - userEvent.click(link); + await userEvent.click(link); expect(window.open).toHaveBeenLastCalledWith('http://dummy.ref', '_blank'); }); diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/GitServices/List/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/GitServices/List/__tests__/index.spec.tsx index 95d328840..df2f6c4f0 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/GitServices/List/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/GitServices/List/__tests__/index.spec.tsx @@ -127,7 +127,7 @@ describe('GitServicesList', () => { expect(gitlabKebab).toBeEnabled(); }); - test('service revocable (github)', () => { + test('service revocable (github)', async () => { renderComponent(props); const rows = screen.getAllByRole('row'); @@ -144,11 +144,11 @@ describe('GitServicesList', () => { expect(githubCheckbox).not.toBeChecked(); // check the checkbox - userEvent.click(githubCheckbox); + await userEvent.click(githubCheckbox); expect(githubCheckbox).toBeChecked(); // uncheck the checkbox - userEvent.click(githubCheckbox); + await userEvent.click(githubCheckbox); expect(githubCheckbox).not.toBeChecked(); // the kebab button is enabled @@ -161,14 +161,14 @@ describe('GitServicesList', () => { } // open kebab menu - userEvent.click(githubKebab); + await userEvent.click(githubKebab); // the revoke button is present const revokeButton = within(githubRow).queryByRole('menuitem', { name: 'Revoke' }); expect(revokeButton).not.toBeNull(); // click the revoke button - userEvent.click(revokeButton!); + await userEvent.click(revokeButton!); expect(props.onRevokeServices).toHaveBeenCalledTimes(1); expect(props.onRevokeServices).toHaveBeenCalledWith([ @@ -179,7 +179,7 @@ describe('GitServicesList', () => { ]); }); - test('can clear opt-out (github)', () => { + test('can clear opt-out (github)', async () => { props = { gitOauth: [ { @@ -218,20 +218,20 @@ describe('GitServicesList', () => { } // open kebab menu - userEvent.click(githubKebab); + await userEvent.click(githubKebab); // the Clear button is present const clearButton = within(githubRow).queryByRole('menuitem', { name: 'Clear' }); expect(clearButton).not.toBeNull(); // click the Clear button - userEvent.click(clearButton!); + await userEvent.click(clearButton!); expect(props.onClearService).toHaveBeenCalledTimes(1); expect(props.onClearService).toHaveBeenCalledWith('github'); }); - test('toolbar', () => { + test('toolbar', async () => { renderComponent(props); const selectedItemsCount = screen.getByTestId('selected-items-count'); @@ -244,14 +244,14 @@ describe('GitServicesList', () => { // check the github row const githubRow = rows[2]; const githubCheckbox = within(githubRow).getByRole('checkbox'); - userEvent.click(githubCheckbox); + await userEvent.click(githubCheckbox); // One item selected expect(selectedItemsCount).toHaveTextContent('1'); // the revoke button in toolbar const revokeButton = screen.getByRole('button', { name: 'Revoke' }); - userEvent.click(revokeButton); + await userEvent.click(revokeButton); expect(props.onRevokeServices).toHaveBeenCalledTimes(1); expect(props.onRevokeServices).toHaveBeenCalledWith([ diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/GitServices/RevokeModal/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/GitServices/RevokeModal/__tests__/index.spec.tsx index 032455805..d895b5889 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/GitServices/RevokeModal/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/GitServices/RevokeModal/__tests__/index.spec.tsx @@ -85,7 +85,7 @@ describe('Revoke Registries Modal', () => { }); }); - test('Cancel button', () => { + test('Cancel button', async () => { renderComponent([ { name: 'github', @@ -94,13 +94,13 @@ describe('Revoke Registries Modal', () => { ]); const cancelButton = screen.getByTestId('cancel-button'); - userEvent.click(cancelButton); + await userEvent.click(cancelButton); expect(mockOnCancel).toHaveBeenCalled(); }); describe('"I understand" checkbox', () => { - test('with Cancel afterwards', () => { + test('with Cancel afterwards', async () => { renderComponent([ { name: 'github', @@ -113,17 +113,17 @@ describe('Revoke Registries Modal', () => { // not checked by default expect(checkbox).not.toBeChecked(); - userEvent.click(checkbox); + await userEvent.click(checkbox); expect(checkbox).toBeChecked(); const cancelButton = screen.getByTestId('cancel-button'); - userEvent.click(cancelButton); + await userEvent.click(cancelButton); expect(checkbox).not.toBeChecked(); }); - test('with Revoke afterwards', () => { + test('with Revoke afterwards', async () => { renderComponent([ { name: 'github', @@ -136,18 +136,18 @@ describe('Revoke Registries Modal', () => { // not checked by default expect(checkbox).not.toBeChecked(); - userEvent.click(checkbox); + await userEvent.click(checkbox); expect(checkbox).toBeChecked(); const revokeButton = screen.getByTestId('revoke-button'); - userEvent.click(revokeButton); + await userEvent.click(revokeButton); expect(checkbox).not.toBeChecked(); }); }); - test('Revoke button', () => { + test('Revoke button', async () => { renderComponent([ { name: 'github', @@ -161,11 +161,11 @@ describe('Revoke Registries Modal', () => { expect(revokeButton).toBeDisabled(); const checkbox = screen.getByTestId('warning-info-checkbox'); - userEvent.click(checkbox); + await userEvent.click(checkbox); expect(revokeButton).toBeEnabled(); - userEvent.click(revokeButton); + await userEvent.click(revokeButton); expect(mockOnRevoke).toHaveBeenCalled(); }); diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/GitServices/Toolbar/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/GitServices/Toolbar/__tests__/index.spec.tsx index c8c3ef75b..204afa05b 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/GitServices/Toolbar/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/GitServices/Toolbar/__tests__/index.spec.tsx @@ -14,7 +14,7 @@ import userEvent from '@testing-library/user-event'; import React from 'react'; import { GitServicesToolbar } from '@/pages/UserPreferences/GitServices/Toolbar'; -import getComponentRenderer, { screen } from '@/services/__mocks__/getComponentRenderer'; +import getComponentRenderer, { screen, waitFor } from '@/services/__mocks__/getComponentRenderer'; import { IGitOauth } from '@/store/GitOauthConfig/types'; const mockOnRevokeButton = jest.fn(); @@ -59,7 +59,7 @@ describe('GitServicesToolbar', () => { expect(revokeButton).toBeDisabled(); }); - test('revoke button click', () => { + test('revoke button click', async () => { renderComponent([ { name: 'github', @@ -70,8 +70,8 @@ describe('GitServicesToolbar', () => { const revokeButton = screen.getByRole('button', { name: 'Revoke' }); expect(revokeButton).toBeEnabled(); - userEvent.click(revokeButton); - expect(mockOnRevokeButton).toHaveBeenCalledTimes(1); + await userEvent.click(revokeButton); + await waitFor(() => expect(mockOnRevokeButton).toHaveBeenCalledTimes(1)); }); }); diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/GitServices/__tests__/__snapshots__/index.spec.tsx.snap b/packages/dashboard-frontend/src/pages/UserPreferences/GitServices/__tests__/__snapshots__/index.spec.tsx.snap index c5347dc3c..80608bf23 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/GitServices/__tests__/__snapshots__/index.spec.tsx.snap +++ b/packages/dashboard-frontend/src/pages/UserPreferences/GitServices/__tests__/__snapshots__/index.spec.tsx.snap @@ -4,9 +4,7 @@ exports[`GitServices snapshot 1`] = ` [ - - , + />,
diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/GitServices/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/GitServices/__tests__/index.spec.tsx index 06482a45b..f314c3dee 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/GitServices/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/GitServices/__tests__/index.spec.tsx @@ -148,13 +148,13 @@ describe('GitServices', () => { ); }); - test('open modal and cancel', () => { + test('open modal and cancel', async () => { renderComponent(store); // click on revoke button in the list const list = screen.getByTestId('git-services-list'); const revokeButton = within(list).getByRole('button', { name: 'Revoke' }); - userEvent.click(revokeButton); + await userEvent.click(revokeButton); // modal is open expect(screen.getByTestId('revoke-modal-is-open')).toHaveTextContent('open'); @@ -163,7 +163,7 @@ describe('GitServices', () => { const modal = screen.getByTestId('git-services-revoke-modal'); const cancelButton = within(modal).getByRole('button', { name: 'Cancel' }); - userEvent.click(cancelButton); + await userEvent.click(cancelButton); // modal is closed expect(screen.getByTestId('revoke-modal-is-open')).toHaveTextContent('closed'); @@ -185,7 +185,7 @@ describe('GitServices', () => { // click on revoke button in the list const list = screen.getByTestId('git-services-list'); const revokeButton = within(list).getByRole('button', { name: 'Revoke' }); - userEvent.click(revokeButton); + await userEvent.click(revokeButton); // modal is open expect(screen.getByTestId('revoke-modal-is-open')).toHaveTextContent('open'); @@ -194,7 +194,7 @@ describe('GitServices', () => { const modal = screen.getByTestId('git-services-revoke-modal'); const revokeButtonOnModal = within(modal).getByRole('button', { name: 'Revoke' }); - userEvent.click(revokeButtonOnModal); + await userEvent.click(revokeButtonOnModal); // modal is closed expect(screen.getByTestId('revoke-modal-is-open')).toHaveTextContent('closed'); diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/GitProviderEndpoint/__tests__/__snapshots__/index.spec.tsx.snap b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/GitProviderEndpoint/__tests__/__snapshots__/index.spec.tsx.snap index 2c37e46b0..175587f16 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/GitProviderEndpoint/__tests__/__snapshots__/index.spec.tsx.snap +++ b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/GitProviderEndpoint/__tests__/__snapshots__/index.spec.tsx.snap @@ -50,7 +50,6 @@ exports[`GitProviderEndpoint snapshot w/o endpoint 1`] = ` type="url" value="https://github.com" /> -
@@ -106,7 +105,6 @@ exports[`GitProviderEndpoint snapshot with endpoint 1`] = ` type="url" value="https://provider.test/endpoint" /> - diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/GitProviderEndpoint/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/GitProviderEndpoint/__tests__/index.spec.tsx index 6f6437e34..77c113dae 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/GitProviderEndpoint/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/GitProviderEndpoint/__tests__/index.spec.tsx @@ -39,66 +39,70 @@ describe('GitProviderEndpoint', () => { expect(snapshot.toJSON()).toMatchSnapshot(); }); - it('should handle a correct endpoint', () => { + it('should handle a correct endpoint', async () => { const endpoint = 'https://provider.test/endpoint'; renderComponent(undefined); expect(mockOnChange).not.toHaveBeenCalled(); const input = screen.getByRole('textbox'); - userEvent.paste(input, endpoint); + await userEvent.click(input); + await userEvent.paste(endpoint); expect(mockOnChange).toHaveBeenCalledWith(endpoint, true); expect(screen.queryByText('The URL is not valid.')).toBeFalsy(); }); - it('should handle a correct endpoint with the port part', () => { + it('should handle a correct endpoint with the port part', async () => { const endpoint = 'https://bitbucket.org:8443'; renderComponent(undefined); expect(mockOnChange).not.toHaveBeenCalled(); const input = screen.getByRole('textbox'); - userEvent.paste(input, endpoint); + await userEvent.click(input); + await userEvent.paste(endpoint); expect(mockOnChange).toHaveBeenCalledWith(expect.stringContaining(endpoint), true); expect(screen.queryByText('The URL is not valid.')).toBeFalsy(); }); - it('should handle endpoint started with an incorrect protocol', () => { + it('should handle endpoint started with an incorrect protocol', async () => { const endpoint = 'asdf://provider/endpoint'; renderComponent(undefined); expect(mockOnChange).not.toHaveBeenCalled(); const input = screen.getByRole('textbox'); - userEvent.paste(input, endpoint); + await userEvent.click(input); + await userEvent.paste(endpoint); expect(mockOnChange).toHaveBeenCalledWith(endpoint, false); expect(screen.queryByText('The URL is not valid.')).toBeTruthy(); }); - it('should handle endpoint w/o protocol', () => { + it('should handle endpoint w/o protocol', async () => { const endpoint = 'provider/endpoint'; renderComponent(undefined); expect(mockOnChange).not.toHaveBeenCalled(); const input = screen.getByRole('textbox'); - userEvent.paste(input, endpoint); + await userEvent.click(input); + await userEvent.paste(endpoint); expect(mockOnChange).toHaveBeenCalledWith(endpoint, false); expect(screen.queryByText('The URL is not valid.')).toBeTruthy(); }); - it('should handle an empty value', () => { + it('should handle an empty value', async () => { const endpoint = 'https://provider.test/endpoint'; renderComponent(endpoint); expect(mockOnChange).not.toHaveBeenCalled(); const input = screen.getByRole('textbox'); - userEvent.clear(input); + await userEvent.clear(input); expect(mockOnChange).toHaveBeenCalledWith('', false); expect(screen.queryByText('This field is required.')).toBeTruthy(); @@ -117,12 +121,13 @@ describe('GitProviderEndpoint', () => { expect(input).toHaveValue(nextDefaultEndpoint); }); - it('should not change value if input is modified', () => { + it('should not change value if input is modified', async () => { const { reRenderComponent } = renderComponent(undefined); const input = screen.getByRole('textbox'); const userModifiedEndpoint = 'https://provider.modified/endpoint'; - userEvent.paste(input, userModifiedEndpoint); + await userEvent.click(input); + await userEvent.paste(userModifiedEndpoint); const nextDefaultEndpoint = 'https://provider.next/endpoint'; reRenderComponent(undefined, nextDefaultEndpoint); diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/GitProviderOrganization/__tests__/__snapshots__/index.spec.tsx.snap b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/GitProviderOrganization/__tests__/__snapshots__/index.spec.tsx.snap index 99edea5a5..b549a103e 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/GitProviderOrganization/__tests__/__snapshots__/index.spec.tsx.snap +++ b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/GitProviderOrganization/__tests__/__snapshots__/index.spec.tsx.snap @@ -50,7 +50,6 @@ exports[`GitProviderOrganization snapshot w/o organization 1`] = ` type="text" value="" /> - @@ -106,7 +105,6 @@ exports[`GitProviderOrganization snapshot with organization 1`] = ` type="text" value="user-organization" /> - diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/GitProviderOrganization/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/GitProviderOrganization/__tests__/index.spec.tsx index 2332cc720..d64731c07 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/GitProviderOrganization/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/GitProviderOrganization/__tests__/index.spec.tsx @@ -37,21 +37,22 @@ describe('GitProviderOrganization', () => { expect(snapshot.toJSON()).toMatchSnapshot(); }); - it('should handle a correct organization', () => { + it('should handle a correct organization', async () => { const organization = 'user-organization'; renderComponent(); expect(mockOnChange).not.toHaveBeenCalled(); const input = screen.getByRole('textbox'); - userEvent.paste(input, organization); + await userEvent.click(input); + await userEvent.paste(organization); expect(mockOnChange).toHaveBeenCalledWith(organization, true); expect(screen.queryByText('This field is required.')).toBeFalsy(); expect(screen.queryByText(/^The Provider Organization is too long./)).toBeFalsy(); }); - it('should handle a too long organization value', () => { + it('should handle a too long organization value', async () => { // make it long enough to be invalid const organization = 'user-organization'.repeat(20); renderComponent(); @@ -59,21 +60,22 @@ describe('GitProviderOrganization', () => { expect(mockOnChange).not.toHaveBeenCalled(); const input = screen.getByRole('textbox'); - userEvent.paste(input, organization); + await userEvent.click(input); + await userEvent.paste(organization); expect(mockOnChange).toHaveBeenCalledWith(organization, false); expect(screen.queryByText('This field is required.')).toBeFalsy(); expect(screen.queryByText(/^The Provider Organization is too long./)).toBeTruthy(); }); - it('should handle an empty value', () => { + it('should handle an empty value', async () => { const organization = 'user-organization'; renderComponent(organization); expect(mockOnChange).not.toHaveBeenCalled(); const input = screen.getByRole('textbox'); - userEvent.clear(input); + await userEvent.clear(input); expect(mockOnChange).toHaveBeenCalledWith('', false); expect(screen.queryByText('This field is required.')).toBeTruthy(); diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/GitProviderSelector/__tests__/__snapshots__/index.spec.tsx.snap b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/GitProviderSelector/__tests__/__snapshots__/index.spec.tsx.snap index 8a2fb0f46..89e5fa811 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/GitProviderSelector/__tests__/__snapshots__/index.spec.tsx.snap +++ b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/GitProviderSelector/__tests__/__snapshots__/index.spec.tsx.snap @@ -74,7 +74,6 @@ exports[`Registry Username Input snapshot 1`] = ` - diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/GitProviderSelector/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/GitProviderSelector/__tests__/index.spec.tsx index ef7f6a929..1469d5d9b 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/GitProviderSelector/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/GitProviderSelector/__tests__/index.spec.tsx @@ -41,12 +41,12 @@ describe('Registry Username Input', () => { expect(dropdownButton).toBeTruthy(); }); - test('available provider options', () => { + test('available provider options', async () => { renderComponent(); // the default dropdown value should be 'GitHub' const dropdownButton = screen.getByRole('button', { name: 'GitHub' }); - userEvent.click(dropdownButton); + await userEvent.click(dropdownButton); expect(screen.queryByRole('menuitem', { name: 'Bitbucket Server' })).toBeTruthy(); expect(screen.queryByRole('menuitem', { name: 'GitHub' })).toBeTruthy(); @@ -54,16 +54,16 @@ describe('Registry Username Input', () => { expect(screen.queryByRole('menuitem', { name: 'Microsoft Azure DevOps' })).toBeTruthy(); }); - it('should select a provider', () => { + it('should select a provider', async () => { renderComponent(); // the default dropdown value should be 'GitHub' const dropdownButton = screen.getByRole('button', { name: 'GitHub' }); - userEvent.click(dropdownButton); + await userEvent.click(dropdownButton); const bitbucketMenuitem = screen.getByRole('menuitem', { name: 'Bitbucket Server' }); - userEvent.click(bitbucketMenuitem); + await userEvent.click(bitbucketMenuitem); expect(mockOnSelect).toHaveBeenCalledWith('bitbucket-server'); expect(screen.queryByRole('button', { name: 'Bitbucket Server' })).toBeTruthy(); diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/TokenData/__tests__/__snapshots__/index.spec.tsx.snap b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/TokenData/__tests__/__snapshots__/index.spec.tsx.snap index d656e6d2b..cb5cbaa6d 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/TokenData/__tests__/__snapshots__/index.spec.tsx.snap +++ b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/TokenData/__tests__/__snapshots__/index.spec.tsx.snap @@ -43,7 +43,6 @@ exports[`TokenData snapshot w/o token data 1`] = ` type="password" value="" /> - @@ -92,7 +91,6 @@ exports[`TokenData snapshot with token data 1`] = ` type="password" value="" /> - diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/TokenName/__tests__/__snapshots__/index.spec.tsx.snap b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/TokenName/__tests__/__snapshots__/index.spec.tsx.snap index bc9645ebd..7f88c89fe 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/TokenName/__tests__/__snapshots__/index.spec.tsx.snap +++ b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/TokenName/__tests__/__snapshots__/index.spec.tsx.snap @@ -113,7 +113,6 @@ exports[`TokenName snapshot with token name 1`] = ` type="text" value="github-token" /> - diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/__tests__/index.spec.tsx index c609a760d..1a956f427 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/Form/__tests__/index.spec.tsx @@ -122,14 +122,14 @@ describe('AddEditModalForm', () => { }); describe('Git provider', () => { - it('should handle changing the git provider', () => { + it('should handle changing the git provider', async () => { renderComponent({ isEdit: false, token: undefined }); // git provider name field const gitProviderButton = screen.getByRole('button', { name: 'Submit Provider GitHub', }); - userEvent.click(gitProviderButton); + await userEvent.click(gitProviderButton); // expect mockOnChange was called expect(mockOnChange).toHaveBeenCalledWith( @@ -141,7 +141,7 @@ describe('AddEditModalForm', () => { ); }); - it('should reveal the git organization field', () => { + it('should reveal the git organization field', async () => { renderComponent({ isEdit: true, token: pat }); // expect there is no organization field @@ -150,13 +150,13 @@ describe('AddEditModalForm', () => { const gitProviderButton = screen.getByRole('button', { name: 'Submit Provider Azure DevOps', }); - userEvent.click(gitProviderButton); + await userEvent.click(gitProviderButton); // expect there is the organization field () => expect(screen.queryByTestId('git-provider-organization')).toBeTruthy(); }); - it('should hide the git organization field', () => { + it('should hide the git organization field', async () => { renderComponent({ isEdit: true, token: patWithOrganization }); // expect the organization field is visible @@ -166,20 +166,20 @@ describe('AddEditModalForm', () => { const gitProviderButton = screen.getByRole('button', { name: 'Submit Provider GitHub', }); - userEvent.click(gitProviderButton); + await userEvent.click(gitProviderButton); // expect there is no organization field () => expect(screen.queryByTestId('git-provider-organization')).toBeFalsy(); }); - it('should hide the git organization field and re-validate the form', () => { + it('should hide the git organization field and re-validate the form', async () => { renderComponent({ isEdit: true, token: patWithOrganization }); // invalidate the form const gitProviderOrganizationButton = screen.getByRole('button', { name: 'Submit Invalid Git Provider Organization', }); - userEvent.click(gitProviderOrganizationButton); + await userEvent.click(gitProviderOrganizationButton); // expect mockOnChange was called with invalid form expect(mockOnChange).toHaveBeenLastCalledWith( @@ -194,7 +194,7 @@ describe('AddEditModalForm', () => { const gitProviderButton = screen.getByRole('button', { name: 'Submit Provider GitHub', }); - userEvent.click(gitProviderButton); + await userEvent.click(gitProviderButton); // expect mockOnChange was called with valid form expect(mockOnChange).toHaveBeenLastCalledWith( @@ -207,14 +207,14 @@ describe('AddEditModalForm', () => { }); describe('Git provider endpoint', () => { - it('should handle changing the git provider endpoint to a valid value', () => { + it('should handle changing the git provider endpoint to a valid value', async () => { renderComponent({ isEdit: true, token: pat }); // git provider endpoint field const gitProviderEndpointField = screen.getByRole('button', { name: NEW_GIT_PROVIDER_ENDPOINT_BUTTON, }); - userEvent.click(gitProviderEndpointField); + await userEvent.click(gitProviderEndpointField); // expect mockOnChange was called expect(mockOnChange).toHaveBeenCalledWith( @@ -225,14 +225,14 @@ describe('AddEditModalForm', () => { ); }); - it('should handle changing the git provider endpoint to an invalid value', () => { + it('should handle changing the git provider endpoint to an invalid value', async () => { renderComponent({ isEdit: true, token: pat }); // git provider endpoint field const gitProviderEndpointField = screen.getByRole('button', { name: INVALID_GIT_PROVIDER_ENDPOINT_BUTTON, }); - userEvent.click(gitProviderEndpointField); + await userEvent.click(gitProviderEndpointField); // expect mockOnChange was called expect(mockOnChange).toHaveBeenCalledWith( @@ -243,14 +243,14 @@ describe('AddEditModalForm', () => { ); }); - it('should use the default git provider endpoint', () => { + it('should use the default git provider endpoint', async () => { renderComponent({ isEdit: false, token: undefined }); // change other field to trigger onChange event const tokenNameField = screen.getByRole('button', { name: 'Submit Valid Token Name', }); - userEvent.click(tokenNameField); + await userEvent.click(tokenNameField); // expect mockOnChange was called expect(mockOnChange).toHaveBeenLastCalledWith( @@ -264,7 +264,7 @@ describe('AddEditModalForm', () => { const gitProviderButton = screen.getByRole('button', { name: 'Submit Provider Azure DevOps', }); - userEvent.click(gitProviderButton); + await userEvent.click(gitProviderButton); // expect mockOnChange was called expect(mockOnChange).toHaveBeenLastCalledWith( @@ -277,14 +277,14 @@ describe('AddEditModalForm', () => { }); describe('Git provider organization', () => { - it('should handle changing the git provider organization to a valid value', () => { + it('should handle changing the git provider organization to a valid value', async () => { renderComponent({ isEdit: true, token: patWithOrganization }); // git provider name field const gitProviderOrganizationField = screen.getByRole('button', { name: NEW_GIT_PROVIDER_ORGANIZATION_BUTTON, }); - userEvent.click(gitProviderOrganizationField); + await userEvent.click(gitProviderOrganizationField); // expect mockOnChange was called expect(mockOnChange).toHaveBeenLastCalledWith( @@ -295,14 +295,14 @@ describe('AddEditModalForm', () => { ); }); - it('should handle changing the git provider organization to a an invalid value', () => { + it('should handle changing the git provider organization to a an invalid value', async () => { renderComponent({ isEdit: true, token: patWithOrganization }); // git provider name field const gitProviderOrganizationField = screen.getByRole('button', { name: INVALID_GIT_PROVIDER_ORGANIZATION_BUTTON, }); - userEvent.click(gitProviderOrganizationField); + await userEvent.click(gitProviderOrganizationField); // expect mockOnChange was called expect(mockOnChange).toHaveBeenLastCalledWith( @@ -315,14 +315,14 @@ describe('AddEditModalForm', () => { }); describe('Token Name', () => { - it('should handle a valid value', () => { + it('should handle a valid value', async () => { renderComponent({ isEdit: true, token: pat }); // token name field const tokenNameField = screen.getByRole('button', { name: NEW_TOKEN_NAME_BUTTON, }); - userEvent.click(tokenNameField); + await userEvent.click(tokenNameField); // expect mockOnChange was called expect(mockOnChange).toHaveBeenCalledWith( @@ -333,14 +333,14 @@ describe('AddEditModalForm', () => { ); }); - it('should handle an invalid value', () => { + it('should handle an invalid value', async () => { renderComponent({ isEdit: true, token: pat }); // token name field const tokenNameField = screen.getByRole('button', { name: INVALID_TOKEN_NAME_BUTTON, }); - userEvent.click(tokenNameField); + await userEvent.click(tokenNameField); // expect mockOnChange was called expect(mockOnChange).toHaveBeenCalledWith( @@ -354,14 +354,14 @@ describe('AddEditModalForm', () => { describe('Token Data', () => { describe('in add mode', () => { - it('should handle a valid value', () => { + it('should handle a valid value', async () => { renderComponent({ isEdit: false, token: undefined }); // token data field const tokenNameField = screen.getByRole('button', { name: NEW_TOKEN_DATA_BUTTON, }); - userEvent.click(tokenNameField); + await userEvent.click(tokenNameField); // expect mockOnChange was called expect(mockOnChange).toHaveBeenCalledWith( @@ -372,14 +372,14 @@ describe('AddEditModalForm', () => { ); }); - it('should handle an invalid value', () => { + it('should handle an invalid value', async () => { renderComponent({ isEdit: false, token: undefined }); // token data field const tokenNameField = screen.getByRole('button', { name: INVALID_TOKEN_DATA_BUTTON, }); - userEvent.click(tokenNameField); + await userEvent.click(tokenNameField); // expect mockOnChange was called expect(mockOnChange).toHaveBeenCalledWith( @@ -392,14 +392,14 @@ describe('AddEditModalForm', () => { }); describe('in edit mode', () => { - it('should handle a valid value', () => { + it('should handle a valid value', async () => { renderComponent({ isEdit: true, token: pat }); // token data field const tokenNameField = screen.getByRole('button', { name: NEW_TOKEN_DATA_BUTTON, }); - userEvent.click(tokenNameField); + await userEvent.click(tokenNameField); // expect mockOnChange was called expect(mockOnChange).toHaveBeenCalledWith( @@ -410,14 +410,14 @@ describe('AddEditModalForm', () => { ); }); - it('should ignore an invalid value', () => { + it('should ignore an invalid value', async () => { renderComponent({ isEdit: true, token: pat }); // token data field const tokenNameField = screen.getByRole('button', { name: INVALID_TOKEN_DATA_BUTTON, }); - userEvent.click(tokenNameField); + await userEvent.click(tokenNameField); // expect mockOnChange was called expect(mockOnChange).toHaveBeenCalledWith( diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/__tests__/index.spec.tsx index a1e4f6f80..eb3d9abf7 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/AddEditModal/__tests__/index.spec.tsx @@ -51,23 +51,23 @@ describe('AddEditModal', () => { expect(screen.queryByRole('dialog')).toBeTruthy(); }); - it('should handle click on Close button', () => { + it('should handle click on Close button', async () => { renderComponent(true, { isEdit: false, token: undefined }); const closeButton = screen.queryByRole('button', { name: 'Close' }); expect(closeButton).toBeTruthy(); - userEvent.click(closeButton!); + await userEvent.click(closeButton!); expect(mockOnClose).toHaveBeenCalledTimes(1); }); - it('should handle click on Cancel button', () => { + it('should handle click on Cancel button', async () => { renderComponent(true, { isEdit: false, token: undefined }); const cancelButton = screen.queryByRole('button', { name: 'Cancel' }); expect(cancelButton).toBeTruthy(); - userEvent.click(cancelButton!); + await userEvent.click(cancelButton!); expect(mockOnClose).toHaveBeenCalledTimes(1); }); @@ -136,7 +136,7 @@ describe('AddEditModal', () => { const isEdit = false; const isOpen = true; - it('should handle valid personal access token', () => { + it('should handle valid personal access token', async () => { renderComponent(isOpen, { isEdit, token: undefined }); // expect add button to be disabled @@ -146,18 +146,18 @@ describe('AddEditModal', () => { const SubmitValidFormButton = screen.getByRole('button', { name: SUBMIT_VALID_FORM, }); - userEvent.click(SubmitValidFormButton); + await userEvent.click(SubmitValidFormButton); // expect add button to be enabled expect(addButton).toBeEnabled(); - userEvent.click(addButton); + await userEvent.click(addButton); // expect onSave to be called expect(mockOnSave).toHaveBeenCalledTimes(1); }); - it('should handle invalid personal access token', () => { + it('should handle invalid personal access token', async () => { renderComponent(isOpen, { isEdit, token: undefined }); // expect add button to be enabled @@ -167,7 +167,7 @@ describe('AddEditModal', () => { const SubmitInvalidFormButton = screen.getByRole('button', { name: SUBMIT_INVALID_FORM, }); - userEvent.click(SubmitInvalidFormButton); + await userEvent.click(SubmitInvalidFormButton); // expect add button to be disabled expect(addButton).toBeDisabled(); diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/DeleteModal/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/DeleteModal/__tests__/index.spec.tsx index b6f106b23..ff5440b7c 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/DeleteModal/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/DeleteModal/__tests__/index.spec.tsx @@ -46,27 +46,27 @@ describe('DeleteModal', () => { expect(screen.queryByRole('dialog')).toBeTruthy(); }); - it('should handle click on Close button', () => { + it('should handle click on Close button', async () => { renderComponent(true, [token1, token2]); const closeButton = screen.queryByRole('button', { name: 'Close' }); expect(closeButton).toBeTruthy(); - userEvent.click(closeButton!); + await userEvent.click(closeButton!); expect(mockOnCloseModal).toHaveBeenCalledTimes(1); }); - it('should handle click on Cancel button', () => { + it('should handle click on Cancel button', async () => { renderComponent(true, [token1, token2]); const cancelButton = screen.queryByRole('button', { name: 'Cancel' }); expect(cancelButton).toBeTruthy(); - userEvent.click(cancelButton!); + await userEvent.click(cancelButton!); expect(mockOnCloseModal).toHaveBeenCalledTimes(1); }); - it('should handle clicks on checkbox and Delete button', () => { + it('should handle clicks on checkbox and Delete button', async () => { renderComponent(true, [token1, token2]); const deleteButton = screen.queryByRole('button', { name: 'Delete' }); @@ -76,10 +76,10 @@ describe('DeleteModal', () => { const checkbox = screen.queryByRole('checkbox'); expect(checkbox).toBeTruthy(); - userEvent.click(checkbox!); + await userEvent.click(checkbox!); expect(deleteButton).toBeEnabled(); - userEvent.click(deleteButton!); + await userEvent.click(deleteButton!); expect(mockOnDelete).toHaveBeenCalledTimes(1); }); }); diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/__tests__/__snapshots__/index.spec.tsx.snap b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/__tests__/__snapshots__/index.spec.tsx.snap index 238622415..82267a564 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/__tests__/__snapshots__/index.spec.tsx.snap +++ b/packages/dashboard-frontend/src/pages/UserPreferences/PersonalAccessTokens/__tests__/__snapshots__/index.spec.tsx.snap @@ -4,9 +4,7 @@ exports[`PersonalAccessTokens should match the snapshot with no tokens 1`] = ` [ - - , + />,
@@ -89,9 +87,7 @@ exports[`PersonalAccessTokens should match the snapshot with tokens 1`] = ` [ - - , + />,
diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/SshKeys/AddModal/Form/SshPrivateKey/__tests__/__snapshots__/index.spec.tsx.snap b/packages/dashboard-frontend/src/pages/UserPreferences/SshKeys/AddModal/Form/SshPrivateKey/__tests__/__snapshots__/index.spec.tsx.snap index ecbe0d305..1a235daff 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/SshKeys/AddModal/Form/SshPrivateKey/__tests__/__snapshots__/index.spec.tsx.snap +++ b/packages/dashboard-frontend/src/pages/UserPreferences/SshKeys/AddModal/Form/SshPrivateKey/__tests__/__snapshots__/index.spec.tsx.snap @@ -52,7 +52,6 @@ exports[`SshPrivateKey snapshot 1`] = ` placeholder="Or paste the PRIVATE key" />
-
diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/SshKeys/AddModal/Form/SshPrivateKey/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/SshKeys/AddModal/Form/SshPrivateKey/__tests__/index.spec.tsx index b2f6d691d..7d138e939 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/SshKeys/AddModal/Form/SshPrivateKey/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/SshKeys/AddModal/Form/SshPrivateKey/__tests__/index.spec.tsx @@ -35,7 +35,7 @@ describe('SshPrivateKey', () => { }); describe('file upload', () => { - it('should handle SSH private key', () => { + it('should handle SSH private key', async () => { renderComponent(); expect(mockOnChange).not.toHaveBeenCalled(); @@ -43,7 +43,8 @@ describe('SshPrivateKey', () => { const input = screen.getByPlaceholderText('Upload the PRIVATE key'); const sshPrivateKey = 'ssh-private-key'; - userEvent.paste(input, sshPrivateKey); + await userEvent.click(input); + await userEvent.paste(sshPrivateKey); const expectedSshPrivateKey = btoa(sshPrivateKey.trim() + '\n'); @@ -53,19 +54,20 @@ describe('SshPrivateKey', () => { expect(screen.queryByText(MAX_LENGTH_ERROR)).toBeFalsy(); }); - it('should handle the wrong file type', () => { + it('should handle the wrong file type', async () => { renderComponent(); expect(mockOnChange).not.toHaveBeenCalled(); const input = screen.getByPlaceholderText('Upload the PRIVATE key'); - userEvent.paste(input, 'ssh-private-key'); + await userEvent.click(input); + await userEvent.paste('ssh-private-key'); mockOnChange.mockClear(); const sshPrivateKey = ''; - userEvent.clear(input); + await userEvent.clear(input); expect(mockOnChange).toHaveBeenCalledWith(sshPrivateKey, false); expect(screen.queryByText(WRONG_TYPE_ERROR)).toBeTruthy(); @@ -73,7 +75,7 @@ describe('SshPrivateKey', () => { expect(screen.queryByText(MAX_LENGTH_ERROR)).toBeFalsy(); }); - it('should handle large file', () => { + it('should handle large file', async () => { renderComponent(); expect(mockOnChange).not.toHaveBeenCalled(); @@ -81,7 +83,8 @@ describe('SshPrivateKey', () => { const input = screen.getByPlaceholderText('Upload the PRIVATE key'); const sshPrivateKey = 'ssh-private-key'.repeat(5000); - userEvent.paste(input, sshPrivateKey); + await userEvent.click(input); + await userEvent.paste(sshPrivateKey); const expectedSshPrivateKey = btoa(sshPrivateKey.trim() + '\n'); @@ -93,7 +96,7 @@ describe('SshPrivateKey', () => { }); describe('text area', () => { - it('should handle SSH private key', () => { + it('should handle SSH private key', async () => { renderComponent(); expect(mockOnChange).not.toHaveBeenCalled(); @@ -102,7 +105,8 @@ describe('SshPrivateKey', () => { // fill the SSH key data field const sshPrivateKey = 'ssh-key-data'; - userEvent.paste(input, sshPrivateKey); + await userEvent.click(input); + await userEvent.paste(sshPrivateKey); const expectedSshPrivateKey = btoa(sshPrivateKey.trim() + '\n'); @@ -112,7 +116,7 @@ describe('SshPrivateKey', () => { expect(screen.queryByText(MAX_LENGTH_ERROR)).toBeFalsy(); }); - it('should handle the empty value', () => { + it('should handle the empty value', async () => { renderComponent(); expect(mockOnChange).not.toHaveBeenCalled(); @@ -121,12 +125,13 @@ describe('SshPrivateKey', () => { // fill the SSH key data field const sshPrivateKey = 'ssh-key-data'; - userEvent.paste(input, sshPrivateKey); + await userEvent.click(input); + await userEvent.paste(sshPrivateKey); mockOnChange.mockClear(); // clear the SSH key data field - userEvent.clear(input); + await userEvent.clear(input); expect(mockOnChange).toHaveBeenCalledWith('', false); expect(screen.queryByText(REQUIRED_ERROR)).toBeTruthy(); @@ -135,7 +140,7 @@ describe('SshPrivateKey', () => { expect(screen.queryByText(MAX_LENGTH_ERROR)).toBeFalsy(); }); - it('should handle large text content', () => { + it('should handle large text content', async () => { renderComponent(); expect(mockOnChange).not.toHaveBeenCalled(); @@ -144,7 +149,8 @@ describe('SshPrivateKey', () => { // fill the SSH key data field const sshPrivateKey = 'ssh-key-data'.repeat(5000); - userEvent.paste(input, sshPrivateKey); + await userEvent.click(input); + await userEvent.paste(sshPrivateKey); const expectedSshPrivateKey = btoa(sshPrivateKey.trim() + '\n'); diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/SshKeys/AddModal/Form/SshPublicKey/__tests__/__snapshots__/index.spec.tsx.snap b/packages/dashboard-frontend/src/pages/UserPreferences/SshKeys/AddModal/Form/SshPublicKey/__tests__/__snapshots__/index.spec.tsx.snap index 4f3546900..c9618c986 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/SshKeys/AddModal/Form/SshPublicKey/__tests__/__snapshots__/index.spec.tsx.snap +++ b/packages/dashboard-frontend/src/pages/UserPreferences/SshKeys/AddModal/Form/SshPublicKey/__tests__/__snapshots__/index.spec.tsx.snap @@ -52,7 +52,6 @@ exports[`SshPublicKey snapshot 1`] = ` placeholder="Or paste the PUBLIC key" /> - diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/SshKeys/AddModal/Form/SshPublicKey/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/SshKeys/AddModal/Form/SshPublicKey/__tests__/index.spec.tsx index c25dc641d..4d8d6de9e 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/SshKeys/AddModal/Form/SshPublicKey/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/SshKeys/AddModal/Form/SshPublicKey/__tests__/index.spec.tsx @@ -35,7 +35,7 @@ describe('SshPublicKey', () => { }); describe('file upload', () => { - it('should handle SSH public key', () => { + it('should handle SSH public key', async () => { renderComponent(); expect(mockOnChange).not.toHaveBeenCalled(); @@ -43,7 +43,8 @@ describe('SshPublicKey', () => { const input = screen.getByPlaceholderText('Upload the PUBLIC key'); const sshPublicKey = 'ssh-public-key'; - userEvent.paste(input, sshPublicKey); + await userEvent.click(input); + await userEvent.paste(sshPublicKey); const expectedSshPrivateKey = btoa(sshPublicKey.trim() + '\n'); @@ -53,7 +54,7 @@ describe('SshPublicKey', () => { expect(screen.queryByText(MAX_LENGTH_ERROR)).toBeFalsy(); }); - it('should handle the wrong file type', () => { + it('should handle the wrong file type', async () => { renderComponent(); expect(mockOnChange).not.toHaveBeenCalled(); @@ -61,7 +62,8 @@ describe('SshPublicKey', () => { const input = screen.getByPlaceholderText('Upload the PUBLIC key'); // fill the SSH public key field - userEvent.paste(input, 'ssh-public-key'); + await userEvent.click(input); + await userEvent.paste('ssh-public-key'); mockOnChange.mockClear(); @@ -75,7 +77,7 @@ describe('SshPublicKey', () => { expect(screen.queryByText(MAX_LENGTH_ERROR)).toBeFalsy(); }); - it('should handle large file', () => { + it('should handle large file', async () => { renderComponent(); expect(mockOnChange).not.toHaveBeenCalled(); @@ -84,7 +86,8 @@ describe('SshPublicKey', () => { // fill the SSH public key field const sshPublicKey = 'ssh-public-key'.repeat(1000); - userEvent.paste(input, sshPublicKey); + await userEvent.click(input); + await userEvent.paste(sshPublicKey); const expectedSshPublicKey = btoa(sshPublicKey.trim() + '\n'); @@ -96,7 +99,7 @@ describe('SshPublicKey', () => { }); describe('text area', () => { - it('should handle SSH public key', () => { + it('should handle SSH public key', async () => { renderComponent(); expect(mockOnChange).not.toHaveBeenCalled(); @@ -104,7 +107,8 @@ describe('SshPublicKey', () => { const input = screen.getByPlaceholderText('Or paste the PUBLIC key'); const sshPublicKey = 'ssh-key-data'; - userEvent.paste(input, sshPublicKey); + await userEvent.click(input); + await userEvent.paste(sshPublicKey); const expectedSshPublicKey = btoa(sshPublicKey.trim() + '\n'); @@ -114,7 +118,7 @@ describe('SshPublicKey', () => { expect(screen.queryByText(MAX_LENGTH_ERROR)).toBeFalsy(); }); - it('should handle the empty value', () => { + it('should handle the empty value', async () => { renderComponent(); expect(mockOnChange).not.toHaveBeenCalled(); @@ -122,12 +126,13 @@ describe('SshPublicKey', () => { const input = screen.getByPlaceholderText('Or paste the PUBLIC key'); // fill the SSH key data field - userEvent.paste(input, 'ssh-key-data'); + await userEvent.click(input); + await userEvent.paste('ssh-key-data'); mockOnChange.mockClear(); // clear the SSH key data field - userEvent.clear(input); + await userEvent.clear(input); expect(mockOnChange).toHaveBeenCalledWith('', false); expect(screen.queryByText(WRONG_TYPE_ERROR)).toBeFalsy(); @@ -135,7 +140,7 @@ describe('SshPublicKey', () => { expect(screen.queryByText(MAX_LENGTH_ERROR)).toBeFalsy(); }); - it('should handle large file', () => { + it('should handle large file', async () => { renderComponent(); expect(mockOnChange).not.toHaveBeenCalled(); @@ -144,7 +149,8 @@ describe('SshPublicKey', () => { // fill the SSH key data field const sshPublicKey = 'ssh-key-data'.repeat(1000); - userEvent.paste(input, sshPublicKey); + await userEvent.click(input); + await userEvent.paste(sshPublicKey); const expectedSshPublicKey = btoa(sshPublicKey.trim() + '\n'); diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/SshKeys/AddModal/Form/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/SshKeys/AddModal/Form/__tests__/index.spec.tsx index fe0ab549e..aafb99457 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/SshKeys/AddModal/Form/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/SshKeys/AddModal/Form/__tests__/index.spec.tsx @@ -43,7 +43,7 @@ describe('AddModalForm', () => { }); describe('SSH Private Key', () => { - it('should handle a valid value', () => { + it('should handle a valid value', async () => { renderComponent({ publicKey: NEW_SSH_PUBLIC_KEY, publicKeyIsValid: true, @@ -53,7 +53,7 @@ describe('AddModalForm', () => { const sshKeyNameField = screen.getByRole('button', { name: NEW_SSH_PRIVATE_KEY_BUTTON, }); - userEvent.click(sshKeyNameField); + await userEvent.click(sshKeyNameField); // expect mockOnChange was called expect(mockOnChange).toHaveBeenCalledWith( @@ -64,7 +64,7 @@ describe('AddModalForm', () => { ); }); - it('should handle an invalid value', () => { + it('should handle an invalid value', async () => { renderComponent({ publicKey: NEW_SSH_PUBLIC_KEY, publicKeyIsValid: true, @@ -74,7 +74,7 @@ describe('AddModalForm', () => { const sshKeyNameField = screen.getByRole('button', { name: INVALID_SSH_PRIVATE_KEY_BUTTON, }); - userEvent.click(sshKeyNameField); + await userEvent.click(sshKeyNameField); // expect mockOnChange was called expect(mockOnChange).toHaveBeenCalledWith( @@ -87,7 +87,7 @@ describe('AddModalForm', () => { }); describe('SSH Public Key', () => { - it('should handle a valid value', () => { + it('should handle a valid value', async () => { renderComponent({ privateKey: NEW_SSH_PRIVATE_KEY, privateKeyIsValid: true, @@ -97,7 +97,7 @@ describe('AddModalForm', () => { const sshKeyNameField = screen.getByRole('button', { name: NEW_SSH_PUBLIC_KEY_BUTTON, }); - userEvent.click(sshKeyNameField); + await userEvent.click(sshKeyNameField); // expect mockOnChange was called expect(mockOnChange).toHaveBeenCalledWith( @@ -108,7 +108,7 @@ describe('AddModalForm', () => { ); }); - it('should handle an invalid value', () => { + it('should handle an invalid value', async () => { renderComponent({ privateKey: NEW_SSH_PUBLIC_KEY, privateKeyIsValid: true, @@ -118,7 +118,7 @@ describe('AddModalForm', () => { const sshKeyNameField = screen.getByRole('button', { name: INVALID_SSH_PUBLIC_KEY_BUTTON, }); - userEvent.click(sshKeyNameField); + await userEvent.click(sshKeyNameField); // expect mockOnChange was called expect(mockOnChange).toHaveBeenCalledWith( diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/SshKeys/AddModal/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/SshKeys/AddModal/__tests__/index.spec.tsx index 4025bc862..7a2407b75 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/SshKeys/AddModal/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/SshKeys/AddModal/__tests__/index.spec.tsx @@ -47,23 +47,23 @@ describe('AddModal', () => { expect(screen.queryByRole('dialog')).toBeTruthy(); }); - it('should handle click on Close button', () => { + it('should handle click on Close button', async () => { renderComponent(true); const closeButton = screen.queryByRole('button', { name: 'Close' }); expect(closeButton).toBeTruthy(); - userEvent.click(closeButton!); + await userEvent.click(closeButton!); expect(mockOnClose).toHaveBeenCalledTimes(1); }); - it('should handle click on Cancel button', () => { + it('should handle click on Cancel button', async () => { renderComponent(true); const cancelButton = screen.queryByRole('button', { name: 'Cancel' }); expect(cancelButton).toBeTruthy(); - userEvent.click(cancelButton!); + await userEvent.click(cancelButton!); expect(mockOnClose).toHaveBeenCalledTimes(1); }); @@ -99,7 +99,7 @@ describe('AddModal', () => { describe('should handle saving SSH key', () => { const isOpen = true; - it('should handle valid SSH key', () => { + it('should handle valid SSH key', async () => { renderComponent(isOpen); // expect add button to be disabled @@ -109,18 +109,18 @@ describe('AddModal', () => { const SubmitValidFormButton = screen.getByRole('button', { name: SUBMIT_VALID_FORM, }); - userEvent.click(SubmitValidFormButton); + await userEvent.click(SubmitValidFormButton); // expect add button to be enabled expect(addButton).toBeEnabled(); - userEvent.click(addButton); + await userEvent.click(addButton); // expect onSave to be called expect(mockOnSave).toHaveBeenCalledTimes(1); }); - it('should handle invalid SSH key', () => { + it('should handle invalid SSH key', async () => { renderComponent(isOpen); // expect add button to be enabled @@ -130,7 +130,7 @@ describe('AddModal', () => { const SubmitInvalidFormButton = screen.getByRole('button', { name: SUBMIT_INVALID_FORM, }); - userEvent.click(SubmitInvalidFormButton); + await userEvent.click(SubmitInvalidFormButton); // expect add button to be disabled expect(addButton).toBeDisabled(); diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/SshKeys/DeleteModal/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/SshKeys/DeleteModal/__tests__/index.spec.tsx index 500fbd9b0..e334d6781 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/SshKeys/DeleteModal/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/SshKeys/DeleteModal/__tests__/index.spec.tsx @@ -43,27 +43,27 @@ describe('DeleteModal', () => { expect(screen.queryByRole('dialog')).toBeTruthy(); }); - it('should handle click on Close button', () => { + it('should handle click on Close button', async () => { renderComponent(true, [sshKey1, sshKey2]); const closeButton = screen.queryByRole('button', { name: 'Close' }); expect(closeButton).toBeTruthy(); - userEvent.click(closeButton!); + await userEvent.click(closeButton!); expect(mockOnCloseModal).toHaveBeenCalledTimes(1); }); - it('should handle click on Cancel button', () => { + it('should handle click on Cancel button', async () => { renderComponent(true, [sshKey1, sshKey2]); const cancelButton = screen.queryByRole('button', { name: 'Cancel' }); expect(cancelButton).toBeTruthy(); - userEvent.click(cancelButton!); + await userEvent.click(cancelButton!); expect(mockOnCloseModal).toHaveBeenCalledTimes(1); }); - it('should handle clicks on checkbox and Delete button', () => { + it('should handle clicks on checkbox and Delete button', async () => { renderComponent(true, [sshKey1, sshKey2]); const deleteButton = screen.queryByRole('button', { name: 'Delete' }); @@ -73,10 +73,10 @@ describe('DeleteModal', () => { const checkbox = screen.queryByRole('checkbox'); expect(checkbox).toBeTruthy(); - userEvent.click(checkbox!); + await userEvent.click(checkbox!); expect(deleteButton).toBeEnabled(); - userEvent.click(deleteButton!); + await userEvent.click(deleteButton!); expect(mockOnDelete).toHaveBeenCalledTimes(1); }); }); diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/SshKeys/List/Entry/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/SshKeys/List/Entry/__tests__/index.spec.tsx index 3bb573f11..a2da1a32b 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/SshKeys/List/Entry/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/SshKeys/List/Entry/__tests__/index.spec.tsx @@ -79,15 +79,15 @@ describe('SshKeysListEntry', () => { expect(screen.queryByRole('button', { name: 'Actions' })).not.toBeNull(); }); - it('should reveal the Delete button', () => { + it('should reveal the Delete button', async () => { renderComponent(props); const dropdown = screen.getByRole('button', { name: 'Actions' }); - userEvent.click(dropdown); + await userEvent.click(dropdown); const deleteItem = screen.queryByRole('menuitem', { name: 'Delete' }); expect(deleteItem).not.toBeNull(); - userEvent.click(deleteItem!); + await userEvent.click(deleteItem!); expect(props.onDeleteSshKey).toHaveBeenCalledWith(sshKey); }); }); @@ -101,6 +101,7 @@ describe('SshKeysListEntry', () => { it('should copy the SSH key to the clipboard', async () => { window.prompt = jest.fn(); jest.useFakeTimers(); + const user = userEvent.setup({ advanceTimers: jest.advanceTimersByTime }); renderComponent(props); const copyToClipboard = screen.getByTestId('copy-to-clipboard'); @@ -109,14 +110,14 @@ describe('SshKeysListEntry', () => { expect(screen.queryByText('Copied!')).toBeNull(); expect(screen.queryByText('Copy to clipboard')).not.toBeNull(); - userEvent.click(copyToClipboard); + await user.click(copyToClipboard); // 500ms after click await jest.advanceTimersByTimeAsync(500); expect(screen.queryByText('Copied!')).not.toBeNull(); expect(screen.queryByText('Copy to clipboard')).toBeNull(); - userEvent.click(copyToClipboard); + await user.click(copyToClipboard); // 1000ms after after the second click await jest.advanceTimersByTimeAsync(500); @@ -127,6 +128,9 @@ describe('SshKeysListEntry', () => { await jest.advanceTimersByTimeAsync(5000); expect(screen.queryByText('Copied!')).toBeNull(); expect(screen.queryByText('Copy to clipboard')).not.toBeNull(); + + await jest.runOnlyPendingTimersAsync(); + jest.useRealTimers(); }); }); }); diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/SshKeys/__tests__/__snapshots__/index.spec.tsx.snap b/packages/dashboard-frontend/src/pages/UserPreferences/SshKeys/__tests__/__snapshots__/index.spec.tsx.snap index 06152a940..00cde79e4 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/SshKeys/__tests__/__snapshots__/index.spec.tsx.snap +++ b/packages/dashboard-frontend/src/pages/UserPreferences/SshKeys/__tests__/__snapshots__/index.spec.tsx.snap @@ -4,9 +4,7 @@ exports[`SshKeys should match the snapshot with SSH keys 1`] = ` [ - - , + />,
- - , + />,
diff --git a/packages/dashboard-frontend/src/pages/UserPreferences/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/pages/UserPreferences/__tests__/index.spec.tsx index 7c75f1e48..8aca581e0 100644 --- a/packages/dashboard-frontend/src/pages/UserPreferences/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/pages/UserPreferences/__tests__/index.spec.tsx @@ -97,47 +97,47 @@ describe('UserPreferences', () => { }); describe('Tabs', () => { - it('should activate the Container Registries tab', () => { + it('should activate the Container Registries tab', async () => { renderComponent(); const tab = screen.getByRole('tab', { name: 'Container Registries' }); - userEvent.click(tab); + await userEvent.click(tab); expect(screen.queryByRole('tabpanel', { name: 'Container Registries' })).toBeTruthy(); }); - it('should activate the Git Services tab', () => { + it('should activate the Git Services tab', async () => { renderComponent(); const tab = screen.getByRole('tab', { name: 'Git Services' }); - userEvent.click(tab); + await userEvent.click(tab); expect(screen.queryByRole('tabpanel', { name: 'Git Services' })).toBeTruthy(); }); - it('should activate the Personal Access Tokens tab', () => { + it('should activate the Personal Access Tokens tab', async () => { renderComponent(); const tab = screen.getByRole('tab', { name: 'Personal Access Tokens' }); - userEvent.click(tab); + await userEvent.click(tab); expect(screen.queryByRole('tabpanel', { name: 'Personal Access Tokens' })).toBeTruthy(); }); - it('should activate the Gitconfig tab', () => { + it('should activate the Gitconfig tab', async () => { renderComponent(); const tab = screen.getByRole('tab', { name: 'Gitconfig' }); - userEvent.click(tab); + await userEvent.click(tab); expect(screen.queryByRole('tabpanel', { name: 'Gitconfig' })).toBeTruthy(); }); - it('should activate the SSH Keys tab', () => { + it('should activate the SSH Keys tab', async () => { renderComponent(); const tab = screen.getByRole('tab', { name: 'SSH Keys' }); - userEvent.click(tab); + await userEvent.click(tab); expect(screen.queryByRole('tabpanel', { name: 'SSH Keys' })).toBeTruthy(); }); diff --git a/packages/dashboard-frontend/src/pages/WorkspaceDetails/DevfileEditorTab/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/pages/WorkspaceDetails/DevfileEditorTab/__tests__/index.spec.tsx index e6dcab148..4f05b9b0f 100644 --- a/packages/dashboard-frontend/src/pages/WorkspaceDetails/DevfileEditorTab/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/pages/WorkspaceDetails/DevfileEditorTab/__tests__/index.spec.tsx @@ -44,11 +44,11 @@ describe('DevfileEditorTab', () => { expect(snapshot.toJSON()).toMatchSnapshot(); }); - test('expanded state', () => { + test('expanded state', async () => { renderComponent(true, workspace); const buttonExpand = screen.getByRole('button', { name: 'Expand Editor' }); - userEvent.click(buttonExpand); + await userEvent.click(buttonExpand); const isExpanded = screen.getByTestId('devfile-viewer-is-expanded'); expect(isExpanded).toHaveTextContent('true'); diff --git a/packages/dashboard-frontend/src/pages/WorkspaceDetails/OverviewTab/InfrastructureNamespace/__tests__/__snapshots__/index.spec.tsx.snap b/packages/dashboard-frontend/src/pages/WorkspaceDetails/OverviewTab/InfrastructureNamespace/__tests__/__snapshots__/index.spec.tsx.snap index 6927d7a58..322bf71e8 100644 --- a/packages/dashboard-frontend/src/pages/WorkspaceDetails/OverviewTab/InfrastructureNamespace/__tests__/__snapshots__/index.spec.tsx.snap +++ b/packages/dashboard-frontend/src/pages/WorkspaceDetails/OverviewTab/InfrastructureNamespace/__tests__/__snapshots__/index.spec.tsx.snap @@ -27,7 +27,6 @@ exports[`InfrastructureNamespaceFormGroup screenshot 1`] = ` > user-namespace
-
`; diff --git a/packages/dashboard-frontend/src/pages/WorkspaceDetails/OverviewTab/Projects/__tests__/__snapshots__/index.spec.tsx.snap b/packages/dashboard-frontend/src/pages/WorkspaceDetails/OverviewTab/Projects/__tests__/__snapshots__/index.spec.tsx.snap index 57171be29..d89d898e2 100644 --- a/packages/dashboard-frontend/src/pages/WorkspaceDetails/OverviewTab/Projects/__tests__/__snapshots__/index.spec.tsx.snap +++ b/packages/dashboard-frontend/src/pages/WorkspaceDetails/OverviewTab/Projects/__tests__/__snapshots__/index.spec.tsx.snap @@ -27,7 +27,6 @@ exports[`ProjectsFormGroup screenshot 1`] = ` > project1, project2 - `; diff --git a/packages/dashboard-frontend/src/pages/WorkspaceDetails/OverviewTab/StorageType/__tests__/__snapshots__/index.spec.tsx.snap b/packages/dashboard-frontend/src/pages/WorkspaceDetails/OverviewTab/StorageType/__tests__/__snapshots__/index.spec.tsx.snap index f73ffcaf9..cf3569f2a 100644 --- a/packages/dashboard-frontend/src/pages/WorkspaceDetails/OverviewTab/StorageType/__tests__/__snapshots__/index.spec.tsx.snap +++ b/packages/dashboard-frontend/src/pages/WorkspaceDetails/OverviewTab/StorageType/__tests__/__snapshots__/index.spec.tsx.snap @@ -92,7 +92,6 @@ exports[`StorageTypeFormGroup editable storage type screenshot 1`] = ` - `; @@ -156,7 +155,6 @@ exports[`StorageTypeFormGroup readonly storage type screenshot 1`] = ` > per-workspace - `; diff --git a/packages/dashboard-frontend/src/pages/WorkspaceDetails/OverviewTab/StorageType/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/pages/WorkspaceDetails/OverviewTab/StorageType/__tests__/index.spec.tsx index b658ce2be..8b3233487 100644 --- a/packages/dashboard-frontend/src/pages/WorkspaceDetails/OverviewTab/StorageType/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/pages/WorkspaceDetails/OverviewTab/StorageType/__tests__/index.spec.tsx @@ -69,13 +69,13 @@ describe('StorageTypeFormGroup', () => { }); describe('storage type info modal dialog', () => { - test('show modal', () => { + test('show modal', async () => { renderComponent(store, { readonly }); const button = screen.queryByRole('button', { name: 'Storage Type Info' }); expect(button).not.toBeNull(); - userEvent.click(button!); + await userEvent.click(button!); const modal = screen.queryByRole('dialog', { name: 'Storage Type Info' }); const buttonClose = screen.queryByRole('button', { name: 'Close' }); @@ -86,7 +86,7 @@ describe('StorageTypeFormGroup', () => { expect(documentationLink).not.toBeNull(); }); - test('close modal dialog', () => { + test('close modal dialog', async () => { renderComponent(store, { readonly }, { isInfoOpen: true }); // modal is opened @@ -94,7 +94,7 @@ describe('StorageTypeFormGroup', () => { const buttonClose = screen.getByRole('button', { name: 'Close' }); - userEvent.click(buttonClose!); + await userEvent.click(buttonClose!); // modal is closed expect(screen.queryByRole('dialog', { name: 'Storage Type Info' })).toBeNull(); @@ -102,13 +102,13 @@ describe('StorageTypeFormGroup', () => { }); describe('change storage type modal dialog', () => { - test('show modal', () => { + test('show modal', async () => { renderComponent(store, { readonly }); const button = screen.queryByRole('button', { name: 'Change Storage Type' }); expect(button).not.toBeNull(); - userEvent.click(button!); + await userEvent.click(button!); const modal = screen.queryByRole('dialog', { name: 'Change Storage Type' }); const buttonSave = screen.queryByRole('button', { name: 'Save' }); @@ -121,7 +121,7 @@ describe('StorageTypeFormGroup', () => { expect(buttonCancel).not.toBeNull(); }); - test('close modal dialog', () => { + test('close modal dialog', async () => { renderComponent(store, { readonly }, { isSelectorOpen: true }); // modal is opened @@ -129,20 +129,20 @@ describe('StorageTypeFormGroup', () => { const buttonClose = screen.getByRole('button', { name: 'Close' }); - userEvent.click(buttonClose!); + await userEvent.click(buttonClose!); // modal is closed expect(screen.queryByRole('dialog', { name: 'Change Storage Type' })).toBeNull(); }); - test('change storage type', () => { + test('change storage type', async () => { renderComponent(store, { readonly, storageType: 'ephemeral' }, { isSelectorOpen: true }); const radioPerWorkspace = screen.getByRole('radio', { name: 'Per-workspace' }); const buttonSave = screen.getByRole('button', { name: 'Save' }); - userEvent.click(radioPerWorkspace); - userEvent.click(buttonSave); + await userEvent.click(radioPerWorkspace); + await userEvent.click(buttonSave); // modal is closed expect(screen.queryByRole('dialog', { name: 'Change Storage Type' })).toBeNull(); diff --git a/packages/dashboard-frontend/src/pages/WorkspaceDetails/OverviewTab/WorkspaceName/__tests__/__snapshots__/index.spec.tsx.snap b/packages/dashboard-frontend/src/pages/WorkspaceDetails/OverviewTab/WorkspaceName/__tests__/__snapshots__/index.spec.tsx.snap index 08ba08e87..38b07adce 100644 --- a/packages/dashboard-frontend/src/pages/WorkspaceDetails/OverviewTab/WorkspaceName/__tests__/__snapshots__/index.spec.tsx.snap +++ b/packages/dashboard-frontend/src/pages/WorkspaceDetails/OverviewTab/WorkspaceName/__tests__/__snapshots__/index.spec.tsx.snap @@ -26,7 +26,6 @@ exports[`WorkspaceNameLink screenshot when cluster console is NOT available 1`] > my-project - `; @@ -93,7 +92,6 @@ exports[`WorkspaceNameLink screenshot when cluster console is available 1`] = ` - `; diff --git a/packages/dashboard-frontend/src/pages/WorkspaceDetails/OverviewTab/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/pages/WorkspaceDetails/OverviewTab/__tests__/index.spec.tsx index 10f85dd5f..6eff72f8b 100644 --- a/packages/dashboard-frontend/src/pages/WorkspaceDetails/OverviewTab/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/pages/WorkspaceDetails/OverviewTab/__tests__/index.spec.tsx @@ -46,13 +46,13 @@ describe('OverviewTab', () => { expect(snapshot.toJSON()).toMatchSnapshot(); }); - test('change storage type', () => { + test('change storage type', async () => { renderComponent(workspace); expect(mockOnSave).not.toHaveBeenCalled(); const changeStorageType = screen.getByRole('button', { name: 'Change storage type' }); - userEvent.click(changeStorageType); + await userEvent.click(changeStorageType); expect(mockOnSave).toHaveBeenCalledWith( expect.objectContaining({ storageType: 'per-workspace' }), diff --git a/packages/dashboard-frontend/src/pages/WorkspaceDetails/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/pages/WorkspaceDetails/__tests__/index.spec.tsx index b580e0779..0226b9cd0 100644 --- a/packages/dashboard-frontend/src/pages/WorkspaceDetails/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/pages/WorkspaceDetails/__tests__/index.spec.tsx @@ -85,14 +85,14 @@ describe('Workspace Details page', () => { expect(eventsTab).not.toBeNull(); }); - it('should switch to the Devfile tab', () => { + it('should switch to the Devfile tab', async () => { const workspace = constructWorkspace(devWorkspaceBuilder.build()); renderComponent({ workspace, }); const devfileTab = screen.getByRole('tab', { name: 'Devfile' }); - userEvent.click(devfileTab); + await userEvent.click(devfileTab); const tabpanel = screen.getByRole('tabpanel', { name: 'Devfile' }); expect(tabpanel).not.toBeNull(); @@ -124,14 +124,14 @@ describe('Workspace Details page', () => { }); }); - it('should handle the onSave event', () => { + it('should handle the onSave event', async () => { const workspace = constructWorkspace(devWorkspaceBuilder.build()); renderComponent({ workspace, }); const saveButton = screen.getByRole('button', { name: 'Update workspace' }); - userEvent.click(saveButton); + await userEvent.click(saveButton); expect(mockOnSave).toHaveBeenCalledTimes(1); }); diff --git a/packages/dashboard-frontend/src/pages/WorkspacesList/Toolbar/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/pages/WorkspacesList/Toolbar/__tests__/index.spec.tsx index 0d9a01cb0..b5856c648 100644 --- a/packages/dashboard-frontend/src/pages/WorkspacesList/Toolbar/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/pages/WorkspacesList/Toolbar/__tests__/index.spec.tsx @@ -90,23 +90,23 @@ describe('Workspaces List Toolbar', () => { const checkbox = screen.getByRole('checkbox', { name: /select all workspaces/i }); - userEvent.click(checkbox); + await userEvent.click(checkbox); expect(mockOnToggleSelectAll).toHaveBeenCalledWith(true); }); - it('should emit event when filtering workspaces', () => { + it('should emit event when filtering workspaces', async () => { renderComponent(); const searchbox = screen.getByRole('searchbox'); const searchButton = screen.getByRole('button', { name: /filter workspaces/i }); - userEvent.type(searchbox, workspaces[0].devfile.metadata.name!); - userEvent.click(searchButton); + await userEvent.type(searchbox, workspaces[0].devfile.metadata.name!); + await userEvent.click(searchButton); expect(mockOnFilter).toHaveBeenCalledWith([workspaces[0]]); }); - it('should emit event when deleting selected workspaces', () => { + it('should emit event when deleting selected workspaces', async () => { const selected = [workspaces[0].name, workspaces[1].name, workspaces[2].name]; renderComponent(selected); @@ -114,37 +114,37 @@ describe('Workspaces List Toolbar', () => { expect(deleteButton).toBeEnabled(); - userEvent.click(deleteButton); + await userEvent.click(deleteButton); expect(mockOnBulkDelete).toHaveBeenCalled(); }); - it('should emit event when adding a new workspace', () => { + it('should emit event when adding a new workspace', async () => { renderComponent(); const addButton = screen.getByRole('button', { name: /new workspace/i }); - userEvent.click(addButton); + await userEvent.click(addButton); expect(mockOnAddWorkspace).toHaveBeenCalled(); }); - it('should filter workspaces by hitting Enter key', () => { + it('should filter workspaces by hitting Enter key', async () => { renderComponent(); const searchbox = screen.getByRole('searchbox'); - userEvent.type(searchbox, workspaces[2].devfile.metadata.name!); + await userEvent.type(searchbox, workspaces[2].devfile.metadata.name!); const enterKeydown = new KeyboardEvent('keydown', { code: 'Enter', key: 'a' }); fireEvent(searchbox, enterKeydown); expect(mockOnFilter).toHaveBeenCalledWith([workspaces[2]]); }); - it('should clear filter when Escape is pressed', () => { + it('should clear filter when Escape is pressed', async () => { renderComponent(); const searchbox = screen.getByRole('searchbox'); - userEvent.type(searchbox, workspaces[2].devfile.metadata.name!); + await userEvent.type(searchbox, workspaces[2].devfile.metadata.name!); const escapeKeydown = new KeyboardEvent('keydown', { code: 'Escape', key: 'a' }); fireEvent(searchbox, escapeKeydown); diff --git a/packages/dashboard-frontend/src/pages/WorkspacesList/__tests__/index.spec.tsx b/packages/dashboard-frontend/src/pages/WorkspacesList/__tests__/index.spec.tsx index d7bf046a7..0cbcad9ee 100644 --- a/packages/dashboard-frontend/src/pages/WorkspacesList/__tests__/index.spec.tsx +++ b/packages/dashboard-frontend/src/pages/WorkspacesList/__tests__/index.spec.tsx @@ -88,7 +88,7 @@ describe('Workspaces List Page', () => { }); describe('Toolbar', () => { - it('should select all rows', () => { + it('should select all rows', async () => { renderComponent(); const selectAllCheckbox = screen.getByRole('checkbox', { name: /select all workspaces/i }); @@ -99,21 +99,21 @@ describe('Workspaces List Page', () => { }); // select all workspaces - userEvent.click(selectAllCheckbox); + await await userEvent.click(selectAllCheckbox); rowCheckboxes.forEach(checkbox => { expect(checkbox).toBeChecked(); }); // deselect all workspaces - userEvent.click(selectAllCheckbox); + await userEvent.click(selectAllCheckbox); rowCheckboxes.forEach(checkbox => { expect(checkbox).not.toBeChecked(); }); }); - it('should filter rows', () => { + it('should filter rows', async () => { renderComponent(); const searchbox = screen.getByRole('searchbox'); @@ -123,8 +123,8 @@ describe('Workspaces List Page', () => { // including the header row expect(rows.length).toEqual(workspaces.length + 1); - userEvent.type(searchbox, workspaces[0].name); - userEvent.click(searchButton); + await userEvent.type(searchbox, workspaces[0].name); + await userEvent.click(searchButton); const rowsFiltered = screen.getAllByRole('row'); // including the header row @@ -137,11 +137,11 @@ describe('Workspaces List Page', () => { const searchbox = screen.getByRole('searchbox'); const searchButton = screen.getByRole('button', { name: /filter workspaces/i }); - userEvent.type(searchbox, workspaces[0].name); - userEvent.click(searchButton); + await userEvent.type(searchbox, workspaces[0].name); + await userEvent.click(searchButton); const selectAllCheckbox = screen.getByRole('checkbox', { name: /select all/i }); - userEvent.click(selectAllCheckbox); + await userEvent.click(selectAllCheckbox); const bulkDeleteElem = screen.getByTestId('workspace-actions-bulk-delete'); const workspacesNumber = within(bulkDeleteElem).getByTestId('workspaces-number'); @@ -150,7 +150,7 @@ describe('Workspaces List Page', () => { }); describe('Table', () => { - it('should select a row', () => { + it('should select a row', async () => { renderComponent(); const rowCheckboxes = screen.getAllByRole('checkbox', { name: /select row/i }); @@ -158,7 +158,7 @@ describe('Workspaces List Page', () => { const rowCheckbox = rowCheckboxes[0]; expect(rowCheckbox).not.toBeChecked(); - userEvent.click(rowCheckbox); + await userEvent.click(rowCheckbox); expect(rowCheckbox).toBeChecked(); }); @@ -173,14 +173,14 @@ describe('Workspaces List Page', () => { expect(emptyStateTitle).toBeTruthy(); }); - it('should handle filtering when nothing found', () => { + it('should handle filtering when nothing found', async () => { renderComponent(); const searchbox = screen.getByRole('searchbox'); const searchButton = screen.getByRole('button', { name: /filter workspaces/i }); - userEvent.type(searchbox, 'non-existing workspace'); - userEvent.click(searchButton); + await userEvent.type(searchbox, 'non-existing workspace'); + await userEvent.click(searchButton); const rowsFiltered = screen.getAllByRole('row'); // the header row only diff --git a/packages/dashboard-frontend/src/services/alerts/appAlerts.ts b/packages/dashboard-frontend/src/services/alerts/appAlerts.ts index 6a07e8d32..4e52d1181 100644 --- a/packages/dashboard-frontend/src/services/alerts/appAlerts.ts +++ b/packages/dashboard-frontend/src/services/alerts/appAlerts.ts @@ -39,7 +39,7 @@ export class AppAlerts { } public showAlert(alert: AlertItem): void { - this.removeAlert(alert.key); + this.alerts = this.alerts.filter(_alert => _alert.key !== alert.key); this.alerts.push(alert); this.onChange(); } diff --git a/packages/dashboard-frontend/tsconfig.json b/packages/dashboard-frontend/tsconfig.json index 86d062e86..b4abbfcba 100644 --- a/packages/dashboard-frontend/tsconfig.json +++ b/packages/dashboard-frontend/tsconfig.json @@ -1,31 +1,35 @@ { "extends": "../../tsconfig.json", "compilerOptions": { + "allowJs": true, "allowSyntheticDefaultImports": true, + "baseUrl": "./", + "emitDecoratorMetadata": true, + "experimentalDecorators": true, "jsx": "react", - "module": "esnext", - "noImplicitAny": false, - "preserveConstEnums": true, - "removeComments": true, - "target": "ES2021", "lib": [ "ES2021", "dom" ], - "experimentalDecorators": true, - "emitDecoratorMetadata": true, - "strictPropertyInitialization": false, - "allowJs": true, - "resolveJsonModule": true, - "baseUrl": "./", + "module": "esnext", "moduleResolution": "node", + "noImplicitAny": false, + "outDir": "lib", "paths": { "@/*": [ - "./src/*", - ], + "./src/*" + ] }, - "outDir": "lib", - "rootDir": "src" + "preserveConstEnums": true, + "removeComments": true, + "resolveJsonModule": true, + "rootDir": "src", + "strictPropertyInitialization": false, + "target": "ES2021", + "types": [ + "jest", + "@testing-library/jest-dom" + ] }, "include": [ "src", diff --git a/scripts/yarn/old_version/.deps/dev.md b/scripts/yarn/old_version/.deps/dev.md index 087826a42..75caaa4d9 100644 --- a/scripts/yarn/old_version/.deps/dev.md +++ b/scripts/yarn/old_version/.deps/dev.md @@ -38,7 +38,6 @@ | [`@babel/plugin-syntax-optional-chaining@7.8.3`](https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-optional-chaining) | MIT | clearlydefined | | [`@babel/plugin-syntax-top-level-await@7.14.5`](https://github.com/babel/babel.git) | MIT | clearlydefined | | [`@babel/plugin-syntax-typescript@7.22.5`](https://github.com/babel/babel.git) | MIT | #8994 | -| [`@babel/runtime-corejs3@7.23.2`](https://github.com/babel/babel.git) | MIT | clearlydefined | | [`@babel/template@7.22.15`](https://github.com/babel/babel.git) | MIT | #9017 | | [`@babel/traverse@7.23.2`](https://github.com/babel/babel.git) | MIT | #11520 | | [`@babel/types@7.23.0`](https://github.com/babel/babel.git) | MIT | #11521 | @@ -136,16 +135,16 @@ | [`@sinclair/typebox@0.27.8`](https://github.com/sinclairzx81/typebox) | MIT | clearlydefined | | [`@sinonjs/commons@3.0.0`](git+https://github.com/sinonjs/commons.git) | BSD-3-Clause | #12905 | | [`@sinonjs/fake-timers@10.3.0`](https://github.com/sinonjs/fake-timers.git) | BSD-3-Clause | #9214 | -| [`@testing-library/dom@7.31.2`](https://github.com/testing-library/dom-testing-library) | MIT | transitive dependency | -| [`@testing-library/jest-dom@6.1.4`](https://github.com/testing-library/jest-dom) | MIT | clearlydefined | -| [`@testing-library/react@10.4.9`](https://github.com/testing-library/react-testing-library) | MIT | clearlydefined | -| [`@testing-library/user-event@12.8.3`](https://github.com/testing-library/user-event) | MIT | clearlydefined | +| [`@testing-library/dom@10.4.0`](https://github.com/testing-library/dom-testing-library) | MIT | #15966 | +| [`@testing-library/jest-dom@6.5.0`](https://github.com/testing-library/jest-dom) | MIT | clearlydefined | +| [`@testing-library/react@16.0.1`](https://github.com/testing-library/react-testing-library) | MIT | clearlydefined | +| [`@testing-library/user-event@14.5.2`](https://github.com/testing-library/user-event) | MIT | clearlydefined | | [`@tootallnate/once@2.0.0`](git://github.com/TooTallNate/once.git) | MIT | clearlydefined | | [`@trysound/sax@0.2.0`](git://github.com/svg/sax.git) | ISC | clearlydefined | | [`@tufjs/canonical-json@1.0.0`](git+https://github.com/theupdateframework/tuf-js.git) | MIT | #8047 | | [`@tufjs/models@1.0.4`](git+https://github.com/theupdateframework/tuf-js.git) | MIT | #7600 | | [`@types/args@5.0.2`](https://github.com/DefinitelyTyped/DefinitelyTyped.git) | MIT | clearlydefined | -| [`@types/aria-query@4.2.2`](https://github.com/DefinitelyTyped/DefinitelyTyped.git) | MIT | clearlydefined | +| [`@types/aria-query@5.0.4`](https://github.com/DefinitelyTyped/DefinitelyTyped.git) | MIT | #10958 | | [`@types/babel__core@7.20.3`](https://github.com/DefinitelyTyped/DefinitelyTyped.git) | MIT | clearlydefined | | [`@types/babel__generator@7.6.6`](https://github.com/DefinitelyTyped/DefinitelyTyped.git) | MIT | clearlydefined | | [`@types/babel__template@7.4.3`](https://github.com/DefinitelyTyped/DefinitelyTyped.git) | MIT | clearlydefined | @@ -172,13 +171,12 @@ | [`@types/react-copy-to-clipboard@4.3.0`](https://github.com/DefinitelyTyped/DefinitelyTyped.git) | MIT | clearlydefined | | [`@types/react-router-dom@5.3.3`](https://github.com/DefinitelyTyped/DefinitelyTyped.git) | MIT | clearlydefined | | [`@types/react-router@5.1.20`](https://github.com/DefinitelyTyped/DefinitelyTyped.git) | MIT | clearlydefined | -| [`@types/react-test-renderer@18.0.5`](https://github.com/DefinitelyTyped/DefinitelyTyped.git) | MIT | clearlydefined | +| [`@types/react-test-renderer@18.3.0`](https://github.com/DefinitelyTyped/DefinitelyTyped.git) | MIT | clearlydefined | | [`@types/redux-mock-store@1.0.5`](https://github.com/DefinitelyTyped/DefinitelyTyped.git) | MIT | clearlydefined | | [`@types/request@2.48.12`](https://github.com/DefinitelyTyped/DefinitelyTyped.git) | MIT | clearlydefined | | [`@types/sanitize-html@2.9.3`](https://github.com/DefinitelyTyped/DefinitelyTyped.git) | MIT | clearlydefined | | [`@types/semver@7.5.4`](https://github.com/DefinitelyTyped/DefinitelyTyped.git) | MIT | #10842 | | [`@types/stack-utils@2.0.2`](https://github.com/DefinitelyTyped/DefinitelyTyped.git) | MIT | clearlydefined | -| [`@types/testing-library__jest-dom@5.14.9`](https://github.com/DefinitelyTyped/DefinitelyTyped.git) | MIT | #9436 | | [`@types/webpack@5.28.5`](https://github.com/DefinitelyTyped/DefinitelyTyped.git) | MIT | clearlydefined | | [`@types/yargs-parser@21.0.2`](https://github.com/DefinitelyTyped/DefinitelyTyped.git) | MIT | clearlydefined | | [`@types/yargs@17.0.29`](https://github.com/DefinitelyTyped/DefinitelyTyped.git) | MIT | #7054 | @@ -233,7 +231,7 @@ | [`anymatch@3.1.3`](https://github.com/micromatch/anymatch) | ISC | #5050 | | [`aproba@2.0.0`](https://github.com/iarna/aproba) | ISC | clearlydefined | | [`are-we-there-yet@3.0.1`](https://github.com/npm/are-we-there-yet.git) | ISC | clearlydefined | -| [`aria-query@4.2.2`](git+https://github.com/A11yance/aria-query.git) | Apache-2.0 | clearlydefined | +| [`aria-query@5.3.0`](git+https://github.com/A11yance/aria-query.git) | Apache-2.0 | clearlydefined | | [`array-buffer-byte-length@1.0.0`](git+https://github.com/inspect-js/array-buffer-byte-length.git) | MIT | #7548 | | [`array-differ@3.0.0`](https://github.com/sindresorhus/array-differ.git) | MIT | clearlydefined | | [`array-ify@1.0.0`](https://github.com/stevemao/array-ify.git) | MIT | clearlydefined | @@ -321,7 +319,6 @@ | [`conventional-recommended-bump@6.1.0`](https://github.com/conventional-changelog/conventional-changelog.git) | MIT | clearlydefined | | [`convert-source-map@2.0.0`](git://github.com/thlorenz/convert-source-map.git) | MIT | clearlydefined | | [`copy-webpack-plugin@11.0.0`](https://github.com/webpack-contrib/copy-webpack-plugin.git) | MIT | clearlydefined | -| [`core-js-pure@3.33.2`](https://github.com/zloirock/core-js.git) | MIT | #10961 | | [`core-util-is@1.0.3`](git://github.com/isaacs/core-util-is) | MIT | #5898 | | [`cosmiconfig@7.0.0`](git+https://github.com/davidtheclark/cosmiconfig.git) | MIT | clearlydefined | | [`create-jest@29.7.0`](https://github.com/jestjs/jest.git) | MIT | clearlydefined | @@ -778,7 +775,8 @@ | [`q@1.5.1`](git://github.com/kriskowal/q.git) | MIT | #1020 | | [`queue-microtask@1.2.3`](git://github.com/feross/queue-microtask.git) | MIT | clearlydefined | | [`quick-lru@4.0.1`](https://github.com/sindresorhus/quick-lru.git) | MIT | clearlydefined | -| [`react-test-renderer@16.14.0`](git+https://github.com/facebook/react.git) | MIT | clearlydefined | +| [`react-shallow-renderer@16.15.0`](https://github.com/NMinhNguyen/react-shallow-renderer.git) | MIT | clearlydefined | +| [`react-test-renderer@18.3.1`](https://github.com/facebook/react.git) | MIT | #14587 | | [`read-cmd-shim@3.0.0`](https://github.com/npm/read-cmd-shim.git) | ISC | clearlydefined | | [`read-package-json-fast@3.0.2`](https://github.com/npm/read-package-json-fast.git) | ISC | #5752 | | [`read-package-json@5.0.1`](https://github.com/npm/read-package-json.git) | ISC | clearlydefined | diff --git a/scripts/yarn/old_version/.deps/prod.md b/scripts/yarn/old_version/.deps/prod.md index a07685caa..c90a18e00 100644 --- a/scripts/yarn/old_version/.deps/prod.md +++ b/scripts/yarn/old_version/.deps/prod.md @@ -291,7 +291,7 @@ | [`randombytes@2.1.0`](git@github.com:crypto-browserify/randombytes.git) | MIT | clearlydefined | | [`randomfill@1.0.4`](https://github.com/crypto-browserify/randomfill.git) | MIT | clearlydefined | | [`react-copy-to-clipboard@5.1.0`](https://github.com/nkbt/react-copy-to-clipboard.git) | MIT | clearlydefined | -| [`react-dom@16.14.0`](git+https://github.com/facebook/react.git) | MIT | clearlydefined | +| [`react-dom@18.3.1`](https://github.com/facebook/react.git) | MIT | clearlydefined | | [`react-dropzone@9.0.0`](https://github.com/react-dropzone/react-dropzone.git) | MIT | [CQ22355](https://dev.eclipse.org/ipzilla/show_bug.cgi?id=22355) | | [`react-fast-compare@3.2.2`](https://github.com/FormidableLabs/react-fast-compare) | MIT | clearlydefined | | [`react-helmet@6.1.0`](https://github.com/nfl/react-helmet) | MIT | clearlydefined | @@ -302,7 +302,7 @@ | [`react-router@5.3.4`](https://github.com/remix-run/react-router.git) | MIT | #3024 | | [`react-side-effect@2.1.2`](https://github.com/gaearon/react-side-effect.git) | MIT | clearlydefined | | [`react-tooltip@4.5.1`](https://github.com/ReactTooltip/react-tooltip) | MIT | #5006 | -| [`react@16.14.0`](git+https://github.com/facebook/react.git) | MIT | clearlydefined | +| [`react@18.3.1`](https://github.com/facebook/react.git) | MIT | clearlydefined | | [`readable-stream@3.6.2`](git://github.com/nodejs/readable-stream) | MIT | [CQ22627](https://dev.eclipse.org/ipzilla/show_bug.cgi?id=22627) | | [`real-require@0.2.0`](git+https://github.com/pinojs/real-require.git) | MIT | [clearlydefined](https://clearlydefined.io/definitions/npm/npmjs/-/real-require/0.2.0) | | [`reconnecting-websocket@4.4.0`](git+https://github.com/pladaria/reconnecting-websocket.git) | MIT | #940 | @@ -326,7 +326,7 @@ | [`safe-stable-stringify@2.4.3`](git+https://github.com/BridgeAR/safe-stable-stringify.git) | MIT | clearlydefined | | [`safer-buffer@2.1.2`](git+https://github.com/ChALkeR/safer-buffer.git) | MIT | clearlydefined | | [`sanitize-html@2.13.0`](https://github.com/apostrophecms/sanitize-html.git) | MIT | clearlydefined | -| [`scheduler@0.19.1`](https://github.com/facebook/react.git) | MIT | clearlydefined | +| [`scheduler@0.23.2`](https://github.com/facebook/react.git) | MIT | #14588 | | [`seamless-immutable@7.1.4`](https://github.com/rtfeldman/seamless-immutable.git) | BSD-3-Clause | clearlydefined | | [`secure-json-parse@2.7.0`](git+https://github.com/fastify/secure-json-parse.git) | BSD-3-Clause | clearlydefined | | [`semver@7.5.4`](https://github.com/npm/node-semver.git) | ISC | clearlydefined | diff --git a/scripts/yarn/old_version/yarn.lock b/scripts/yarn/old_version/yarn.lock index fe836bcef..5c3edd953 100644 --- a/scripts/yarn/old_version/yarn.lock +++ b/scripts/yarn/old_version/yarn.lock @@ -7,7 +7,7 @@ resolved "https://registry.yarnpkg.com/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz#bd9154aec9983f77b3a034ecaa015c2e4201f6cf" integrity sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA== -"@adobe/css-tools@^4.3.1", "@adobe/css-tools@^4.3.2": +"@adobe/css-tools@^4.3.2", "@adobe/css-tools@^4.4.0": version "4.4.0" resolved "https://registry.yarnpkg.com/@adobe/css-tools/-/css-tools-4.4.0.tgz#728c484f4e10df03d5a3acd0d8adcbbebff8ad63" integrity sha512-Ff9+ksdQQB3rMncgqDK78uLznstjyfIf2Arnh22pW8kBpLs6rpKDwgnZT46hin5Hl1WzazzK64DOrhSwYpS7bQ== @@ -268,15 +268,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.22.5" -"@babel/runtime-corejs3@^7.10.2": - version "7.23.2" - resolved "https://registry.yarnpkg.com/@babel/runtime-corejs3/-/runtime-corejs3-7.23.2.tgz#a5cd9d8b408fb946b2f074b21ea40c04e516795c" - integrity sha512-54cIh74Z1rp4oIjsHjqN+WM4fMyCBYe+LpZ9jWm51CZ1fbH3SkAzQD/3XLoNkjbJ7YEmjobLXyvQrFypRHOrXw== - dependencies: - core-js-pure "^3.30.2" - regenerator-runtime "^0.14.0" - -"@babel/runtime@^7.0.0", "@babel/runtime@^7.1.2", "@babel/runtime@^7.10.2", "@babel/runtime@^7.10.3", "@babel/runtime@^7.12.5", "@babel/runtime@^7.9.2": +"@babel/runtime@^7.0.0", "@babel/runtime@^7.1.2", "@babel/runtime@^7.12.5", "@babel/runtime@^7.9.2": version "7.23.2" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.23.2.tgz#062b0ac103261d68a966c4c7baf2ae3e62ec3885" integrity sha512-mM8eg4yl5D6i3lu2QKPuPH4FArvJ8KhTofbE7jwMUv9KX5mBvwPAqnV3MlyBNqdp9RyRKP6Yck8TrfYrPvX3bg== @@ -859,17 +851,6 @@ slash "^3.0.0" write-file-atomic "^4.0.2" -"@jest/types@^26.6.2": - version "26.6.2" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-26.6.2.tgz#bef5a532030e1d88a2f5a6d933f84e97226ed48e" - integrity sha512-fC6QCp7Sc5sX6g8Tvbmj4XUTbyrik0akgRy03yjXbQaBWWNWGE7SGtJk98m0N8nzegD/7SggrUlivxo5ax4KWQ== - dependencies: - "@types/istanbul-lib-coverage" "^2.0.0" - "@types/istanbul-reports" "^3.0.0" - "@types/node" "*" - "@types/yargs" "^15.0.0" - chalk "^4.0.0" - "@jest/types@^29.6.3": version "29.6.3" resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.6.3.tgz#1131f8cf634e7e84c5e77bab12f052af585fba59" @@ -1597,49 +1578,45 @@ dependencies: "@sinonjs/commons" "^3.0.0" -"@testing-library/dom@^7.22.3", "@testing-library/dom@^7.30.3": - version "7.31.2" - resolved "https://registry.yarnpkg.com/@testing-library/dom/-/dom-7.31.2.tgz#df361db38f5212b88555068ab8119f5d841a8c4a" - integrity sha512-3UqjCpey6HiTZT92vODYLPxTBWlM8ZOOjr3LX5F37/VRipW2M1kX6I/Cm4VXzteZqfGfagg8yXywpcOgQBlNsQ== +"@testing-library/dom@^10.4.0": + version "10.4.0" + resolved "https://registry.yarnpkg.com/@testing-library/dom/-/dom-10.4.0.tgz#82a9d9462f11d240ecadbf406607c6ceeeff43a8" + integrity sha512-pemlzrSESWbdAloYml3bAJMEfNh1Z7EduzqPKprCH5S341frlpYnUEW0H72dLxa6IsYr+mPno20GiSm+h9dEdQ== dependencies: "@babel/code-frame" "^7.10.4" "@babel/runtime" "^7.12.5" - "@types/aria-query" "^4.2.0" - aria-query "^4.2.2" + "@types/aria-query" "^5.0.1" + aria-query "5.3.0" chalk "^4.1.0" - dom-accessibility-api "^0.5.6" - lz-string "^1.4.4" - pretty-format "^26.6.2" + dom-accessibility-api "^0.5.9" + lz-string "^1.5.0" + 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== +"@testing-library/jest-dom@^6.5.0": + version "6.5.0" + resolved "https://registry.yarnpkg.com/@testing-library/jest-dom/-/jest-dom-6.5.0.tgz#50484da3f80fb222a853479f618a9ce5c47bfe54" + integrity sha512-xGGHpBXYSHUUr6XsKBfs85TWlYKpTc37cSBBVrXcib2MkHLboWlkClhWF37JKlDb9KEq3dHs+f2xR7XJEWGBxA== 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@^10.3.0": - version "10.4.9" - resolved "https://registry.yarnpkg.com/@testing-library/react/-/react-10.4.9.tgz#9faa29c6a1a217bf8bbb96a28bd29d7a847ca150" - integrity sha512-pHZKkqUy0tmiD81afs8xfiuseXfU/N7rAX3iKjeZYje86t9VaB0LrxYVa+OOsvkrveX5jCK3IjajVn2MbePvqA== - dependencies: - "@babel/runtime" "^7.10.3" - "@testing-library/dom" "^7.22.3" - -"@testing-library/user-event@^12.1": - version "12.8.3" - resolved "https://registry.yarnpkg.com/@testing-library/user-event/-/user-event-12.8.3.tgz#1aa3ed4b9f79340a1e1836bc7f57c501e838704a" - integrity sha512-IR0iWbFkgd56Bu5ZI/ej8yQwrkCv8Qydx6RzwbKz9faXazR/+5tvYKsZQgyXJiwgpcva127YO6JcWy7YlCfofQ== +"@testing-library/react@^16.0.1": + version "16.0.1" + resolved "https://registry.yarnpkg.com/@testing-library/react/-/react-16.0.1.tgz#29c0ee878d672703f5e7579f239005e4e0faa875" + integrity sha512-dSmwJVtJXmku+iocRhWOUFbrERC76TX2Mnf0ATODz8brzAZrMBbzLwQixlBSanZxR6LddK3eiwpSFZgDET1URg== dependencies: "@babel/runtime" "^7.12.5" +"@testing-library/user-event@^14.5.2": + version "14.5.2" + resolved "https://registry.yarnpkg.com/@testing-library/user-event/-/user-event-14.5.2.tgz#db7257d727c891905947bd1c1a99da20e03c2ebd" + integrity sha512-YAh82Wh4TIrxYLmfGcixwD18oIjyC1pFQC2Y01F2lzV2HTMiYrI0nze0FD0ocB//CKS/7jIUgae+adPqxK5yCQ== + "@tootallnate/once@2": version "2.0.0" resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-2.0.0.tgz#f544a148d3ab35801c1f633a7441fd87c2e484bf" @@ -1668,10 +1645,10 @@ resolved "https://registry.yarnpkg.com/@types/args/-/args-5.0.2.tgz#7d6639dd18d046d29d48f440308a926403722d16" integrity sha512-bQdYASesybq3LRKrvDHTB8Tc5Y4XaVfbfcb0vl/bt2AQ/+VS+1ySvB72AlWLCO3xBAyrS6X3Gk83ni9PfKXSbA== -"@types/aria-query@^4.2.0": - version "4.2.2" - resolved "https://registry.yarnpkg.com/@types/aria-query/-/aria-query-4.2.2.tgz#ed4e0ad92306a704f9fb132a0cfcf77486dbe2bc" - integrity sha512-HnYpAE1Y6kRyKM/XkEuiRQhTHvkzMBurTHnpFLYLBGPIylZNPs9jJcuOOYWxPLJCSEtmZT0Y8rHDokKN7rRTig== +"@types/aria-query@^5.0.1": + version "5.0.4" + resolved "https://registry.yarnpkg.com/@types/aria-query/-/aria-query-5.0.4.tgz#1a31c3d378850d2778dabb6374d036dcba4ba708" + integrity sha512-rfT93uj5s0PRL7EzccGMs3brplhcrghnDoV26NqKhCAS1hVo+WdNsPvE/yb6ilfr5hi2MEk6d5EWJTKdxg8jVw== "@types/babel__core@^7.1.14": version "7.20.3" @@ -1781,7 +1758,7 @@ dependencies: "@types/istanbul-lib-report" "*" -"@types/jest@*", "@types/jest@^29.5.3": +"@types/jest@^29.5.3": version "29.5.7" resolved "https://registry.yarnpkg.com/@types/jest/-/jest-29.5.7.tgz#2c0dafe2715dd958a455bc10e2ec3e1ec47b5036" integrity sha512-HLyetab6KVPSiF+7pFcUyMeLsx25LDNDemw9mGsJBkai/oouwrjTycocSDYopMEwFhN2Y4s9oPyOCZNofgSt2g== @@ -1906,10 +1883,10 @@ "@types/history" "^4.7.11" "@types/react" "*" -"@types/react-test-renderer@^18.0.0": - version "18.0.5" - resolved "https://registry.yarnpkg.com/@types/react-test-renderer/-/react-test-renderer-18.0.5.tgz#b67a6ff37acd93d1b971ec4c838f69d52e772db0" - integrity sha512-PsnmF4Hpi61PTRX+dTxkjgDdtZ09kFFgPXczoF+yBfOVxn7xBLPvKP1BUrSasYHmerj33rhoJuvpIMsJuyRqHw== +"@types/react-test-renderer@^18.3.0": + version "18.3.0" + resolved "https://registry.yarnpkg.com/@types/react-test-renderer/-/react-test-renderer-18.3.0.tgz#839502eae70058a4ae161f63385a8e7929cef4c0" + integrity sha512-HW4MuEYxfDbOHQsVlY/XtOvNHftCVEPhJF2pQXXwcUiUF+Oyb0usgp48HSgpK5rt8m9KZb22yqOeZm+rrVG8gw== dependencies: "@types/react" "*" @@ -1971,13 +1948,6 @@ resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.2.tgz#01284dde9ef4e6d8cef6422798d9a3ad18a66f8b" integrity sha512-g7CK9nHdwjK2n0ymT2CW698FuWJRIx+RP6embAzZ2Qi8/ilIrA1Imt2LVSeHUzKvpoi7BhmmQcXz95eS0f2JXw== -"@types/testing-library__jest-dom@^5.14.9": - version "5.14.9" - resolved "https://registry.yarnpkg.com/@types/testing-library__jest-dom/-/testing-library__jest-dom-5.14.9.tgz#0fb1e6a0278d87b6737db55af5967570b67cb466" - integrity sha512-FSYhIjFlfOpGSRyVoMBMuS3ws5ehFQODymf3vlI7U1K8c7PHwWwFY7VREfmsuzHSOnoKs/9/Y983ayOs7eRzqw== - dependencies: - "@types/jest" "*" - "@types/tough-cookie@*": version "4.0.4" resolved "https://registry.yarnpkg.com/@types/tough-cookie/-/tough-cookie-4.0.4.tgz#cf2f0c7c51b985b6afecea73eb2cd65421ecb717" @@ -2004,13 +1974,6 @@ resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-21.0.2.tgz#7bd04c5da378496ef1695a1008bf8f71847a8b8b" integrity sha512-5qcvofLPbfjmBfKaLfj/+f+Sbd6pN4zl7w7VSVI5uz7m9QZTuB2aZAa2uo1wHFBNN2x6g/SoTkXmd8mQnQF2Cw== -"@types/yargs@^15.0.0": - version "15.0.17" - resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-15.0.17.tgz#bea870ba551b43831bfaa75de2e4a3849c39322b" - integrity sha512-cj53I8GUcWJIgWVTSVe2L7NJAB5XWGdsoMosVvUgv1jEnMbAcsbaCzt1coUcyi8Sda5PgTWAooG8jNyDTD+CWA== - dependencies: - "@types/yargs-parser" "*" - "@types/yargs@^17.0.8": version "17.0.29" resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-17.0.29.tgz#06aabc72497b798c643c812a8b561537fea760cf" @@ -2415,7 +2378,7 @@ ansi-escapes@^4.2.1: dependencies: type-fest "^0.21.3" -ansi-regex@^5.0.0, ansi-regex@^5.0.1: +ansi-regex@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== @@ -2502,15 +2465,7 @@ args@^5.0.3: leven "2.1.0" mri "1.1.4" -aria-query@^4.2.2: - version "4.2.2" - resolved "https://registry.yarnpkg.com/aria-query/-/aria-query-4.2.2.tgz#0d2ca6c9aceb56b8977e9fed6aed7e15bbd2f83b" - integrity sha512-o/HelwhuKpTj/frsOsbNLNgnNGVIFsVP/SW2BSF14gVl7kAfMOJ6/8wUAUvG1R1NHKrfG+2sHZTu0yauT1qBrA== - dependencies: - "@babel/runtime" "^7.10.2" - "@babel/runtime-corejs3" "^7.10.2" - -aria-query@^5.0.0: +aria-query@5.3.0, aria-query@^5.0.0: version "5.3.0" resolved "https://registry.yarnpkg.com/aria-query/-/aria-query-5.3.0.tgz#650c569e41ad90b51b3d7df5e5eed1c7549c103e" integrity sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A== @@ -3608,11 +3563,6 @@ copy-webpack-plugin@^11.0.0: schema-utils "^4.0.0" serialize-javascript "^6.0.0" -core-js-pure@^3.30.2: - version "3.33.2" - resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.33.2.tgz#644830db2507ef84d068a70980ccd99c275f5fa6" - integrity sha512-a8zeCdyVk7uF2elKIGz67AjcXOxjRbwOLz8SbklEso1V+2DoW4OkAMZN9S9GBgvZIaqQi/OemFX4OiSoQEmg1Q== - core-js@^2.5.0: version "2.6.12" resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.12.tgz#d9333dfa7b065e347cc5682219d6f690859cc2ec" @@ -4140,11 +4090,16 @@ doctrine@^3.0.0: dependencies: esutils "^2.0.2" -dom-accessibility-api@^0.5.6: +dom-accessibility-api@^0.5.9: version "0.5.16" resolved "https://registry.yarnpkg.com/dom-accessibility-api/-/dom-accessibility-api-0.5.16.tgz#5a7429e6066eb3664d911e33fb0e45de8eb08453" integrity sha512-X7BJ2yElsnOJ30pZF4uIIDfBEVgF4XEBxL9Bxhy6dnrm5hkzqmsWHGTiHqRiITNhMyFLyAiWndIJP7Z1NTteDg== +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-converter@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/dom-converter/-/dom-converter-0.2.0.tgz#6721a9daee2e293682955b6afe416771627bb768" @@ -7487,7 +7442,7 @@ lru-cache@^7.4.4, lru-cache@^7.5.1, lru-cache@^7.7.1: resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-10.0.1.tgz#0a3be479df549cca0e5d693ac402ff19537a6b7a" integrity sha512-IJ4uwUTi2qCccrioU6g9g/5rvvVl13bsdczUUcqbciD9iLr095yj8DQKdObriEvuNSx325N1rV1O0sJFszx75g== -lz-string@^1.4.4: +lz-string@^1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/lz-string/-/lz-string-1.5.0.tgz#c1ab50f77887b712621201ba9fd4e3a6ed099941" integrity sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ== @@ -9323,14 +9278,13 @@ pretty-format@29.4.3: ansi-styles "^5.0.0" react-is "^18.0.0" -pretty-format@^26.6.2: - version "26.6.2" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-26.6.2.tgz#e35c2705f14cb7fe2fe94fa078345b444120fc93" - integrity sha512-7AeGuCYNGmycyQbCqd/3PWH4eOoX/OiCa0uphp57NVTeAGdJGaAliecxwBDHYQCIvrW7aDBZCYeNTP/WX69mkg== +pretty-format@^27.0.2: + version "27.5.1" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.5.1.tgz#2181879fdea51a7a5851fb39d920faa63f01d88e" + integrity sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ== dependencies: - "@jest/types" "^26.6.2" - ansi-regex "^5.0.0" - ansi-styles "^4.0.0" + ansi-regex "^5.0.1" + ansi-styles "^5.0.0" react-is "^17.0.1" pretty-format@^29.0.0, pretty-format@^29.7.0: @@ -9560,15 +9514,13 @@ react-copy-to-clipboard@^5.1.0: copy-to-clipboard "^3.3.1" prop-types "^15.8.1" -react-dom@^16.12.0: - version "16.14.0" - resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.14.0.tgz#7ad838ec29a777fb3c75c3a190f661cf92ab8b89" - integrity sha512-1gCeQXDLoIqMgqD3IO2Ah9bnf0w9kzhwN5q4FGnHZ67hBm9yePzB5JJAIQCc8x3pFnNlwFq4RidZggNAAkzWWw== +react-dom@^18.3.1: + version "18.3.1" + resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-18.3.1.tgz#c2265d79511b57d479b3dd3fdfa51536494c5cb4" + integrity sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw== dependencies: loose-envify "^1.1.0" - object-assign "^4.1.1" - prop-types "^15.6.2" - scheduler "^0.19.1" + scheduler "^0.23.2" react-dropzone@9.0.0: version "9.0.0" @@ -9595,7 +9547,12 @@ react-helmet@^6.1.0: react-fast-compare "^3.1.1" react-side-effect "^2.1.0" -react-is@^16.13.1, react-is@^16.3.2, react-is@^16.6.0, react-is@^16.7.0, react-is@^16.8.6: +"react-is@^16.12.0 || ^17.0.0 || ^18.0.0", react-is@^18.3.1: + 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.3.2, react-is@^16.6.0, react-is@^16.7.0: version "16.13.1" resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== @@ -9655,20 +9612,27 @@ react-router@5.3.4, react-router@^5.1.2: tiny-invariant "^1.0.2" tiny-warning "^1.0.0" +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-side-effect@^2.1.0: version "2.1.2" resolved "https://registry.yarnpkg.com/react-side-effect/-/react-side-effect-2.1.2.tgz#dc6345b9e8f9906dc2eeb68700b615e0b4fe752a" integrity sha512-PVjOcvVOyIILrYoyGEpDN3vmYNLdy1CajSFNt4TDsVQC5KpTijDvWVoR+/7Rz2xT978D8/ZtFceXxzsPwZEDvw== -react-test-renderer@^16.14.0: - version "16.14.0" - resolved "https://registry.yarnpkg.com/react-test-renderer/-/react-test-renderer-16.14.0.tgz#e98360087348e260c56d4fe2315e970480c228ae" - integrity sha512-L8yPjqPE5CZO6rKsKXRO/rVPiaCOy0tQQJbC+UjPNlobl5mad59lvPjwFsQHTvL03caVDIVr9x9/OSgDe6I5Eg== +react-test-renderer@^18.3.1: + version "18.3.1" + resolved "https://registry.yarnpkg.com/react-test-renderer/-/react-test-renderer-18.3.1.tgz#e693608a1f96283400d4a3afead6893f958b80b4" + integrity sha512-KkAgygexHUkQqtvvx/otwxtuFu5cVjfzTCtjXLH9boS19/Nbtg84zS7wIQn39G8IlrhThBpQsMKkq5ZHZIYFXA== dependencies: - object-assign "^4.1.1" - prop-types "^15.6.2" - react-is "^16.8.6" - scheduler "^0.19.1" + react-is "^18.3.1" + react-shallow-renderer "^16.15.0" + scheduler "^0.23.2" react-tooltip@^4.5.1: version "4.5.1" @@ -9678,14 +9642,12 @@ react-tooltip@^4.5.1: prop-types "^15.8.1" uuid "^7.0.3" -react@^16.14.0: - version "16.14.0" - resolved "https://registry.yarnpkg.com/react/-/react-16.14.0.tgz#94d776ddd0aaa37da3eda8fc5b6b18a4c9a3114d" - integrity sha512-0X2CImDkJGApiAlcf0ODKIneSwBPhqJawOa5wCtKbu7ZECrmS26NvtSILynQ66cgkT/RJ4LidJOc3bUESwmU8g== +react@^18.3.1: + version "18.3.1" + resolved "https://registry.yarnpkg.com/react/-/react-18.3.1.tgz#49ab892009c53933625bd16b2533fc754cab2891" + integrity sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ== dependencies: loose-envify "^1.1.0" - object-assign "^4.1.1" - prop-types "^15.6.2" read-cmd-shim@3.0.0: version "3.0.0" @@ -10212,13 +10174,12 @@ saxes@^6.0.0: dependencies: xmlchars "^2.2.0" -scheduler@^0.19.1: - version "0.19.1" - resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.19.1.tgz#4f3e2ed2c1a7d65681f4c854fa8c5a1ccb40f196" - integrity sha512-n/zwRWRYSUj0/3g/otKDRPMh6qv2SYMWNq85IEa8iZyAv8od9zDYpGSnpBEjNgcMNq6Scbu5KfIPxNF72R/2EA== +scheduler@^0.23.2: + version "0.23.2" + resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.23.2.tgz#414ba64a3b282892e944cf2108ecc078d115cdc3" + integrity sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ== dependencies: loose-envify "^1.1.0" - object-assign "^4.1.1" schema-utils@^3.0.0, schema-utils@^3.1.1, schema-utils@^3.2.0: version "3.3.0" diff --git a/yarn.lock b/yarn.lock index b818adbaa..47c765fcd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -389,17 +389,7 @@ __metadata: languageName: node linkType: hard -"@babel/runtime-corejs3@npm:^7.10.2": - version: 7.23.2 - resolution: "@babel/runtime-corejs3@npm:7.23.2" - dependencies: - core-js-pure: ^3.30.2 - regenerator-runtime: ^0.14.0 - checksum: 922f25c47996a8af604cea82441e41be8b11910e96c662511e54120078f4c64258c045a28a311467a8f14a0c17f46a1f057f7c0501e567869a4343a6ce017962 - languageName: node - linkType: hard - -"@babel/runtime@npm:^7.0.0, @babel/runtime@npm:^7.1.2, @babel/runtime@npm:^7.10.2, @babel/runtime@npm:^7.10.3, @babel/runtime@npm:^7.12.5, @babel/runtime@npm:^7.9.2": +"@babel/runtime@npm:^7.0.0, @babel/runtime@npm:^7.1.2, @babel/runtime@npm:^7.12.5, @babel/runtime@npm:^7.9.2": version: 7.23.2 resolution: "@babel/runtime@npm:7.23.2" dependencies: @@ -650,10 +640,10 @@ __metadata: "@patternfly/react-icons": ^4.93.7 "@patternfly/react-table": ^4.113.3 "@react-mock/state": ^0.1.8 - "@testing-library/dom": ^7.30.3 - "@testing-library/jest-dom": 6.1.4 - "@testing-library/react": ^10.3.0 - "@testing-library/user-event": ^12.1 + "@testing-library/dom": ^10.4.0 + "@testing-library/jest-dom": ^6.5.0 + "@testing-library/react": ^16.0.1 + "@testing-library/user-event": ^14.5.2 "@types/history": ^4.7.6 "@types/jest": ^29.5.3 "@types/js-yaml": ^4.0.5 @@ -661,10 +651,9 @@ __metadata: "@types/qs": ^6.9.7 "@types/react-copy-to-clipboard": ^4.3.0 "@types/react-router-dom": ^5.3.3 - "@types/react-test-renderer": ^18.0.0 + "@types/react-test-renderer": ^18.3.0 "@types/redux-mock-store": ^1.0.2 "@types/sanitize-html": ^2.9.0 - "@types/testing-library__jest-dom": ^5.14.9 "@types/webpack": ^5.28.5 "@typescript-eslint/eslint-plugin": ^6.4.0 "@typescript-eslint/parser": ^6.4.0 @@ -708,15 +697,15 @@ __metadata: prettier: ^3.2.5 process: ^0.11.10 qs: ^6.12.1 - react: ^16.14.0 + react: ^18.3.1 react-copy-to-clipboard: ^5.1.0 - react-dom: ^16.12.0 + react-dom: ^18.3.1 react-helmet: ^6.1.0 react-pluralize: ^1.6.3 react-redux: ^7.2.9 react-router: ^5.1.2 react-router-dom: ^5.1.2 - react-test-renderer: ^16.14.0 + react-test-renderer: ^18.3.1 react-tooltip: ^4.5.1 reconnecting-websocket: ^4.4.0 redux: ^4.2.1 @@ -1337,19 +1326,6 @@ __metadata: languageName: node linkType: hard -"@jest/types@npm:^26.6.2": - version: 26.6.2 - resolution: "@jest/types@npm:26.6.2" - dependencies: - "@types/istanbul-lib-coverage": ^2.0.0 - "@types/istanbul-reports": ^3.0.0 - "@types/node": "*" - "@types/yargs": ^15.0.0 - chalk: ^4.0.0 - checksum: a0bd3d2f22f26ddb23f41fddf6e6a30bf4fab2ce79ec1cb6ce6fdfaf90a72e00f4c71da91ec61e13db3b10c41de22cf49d07c57ff2b59171d64b29f909c1d8d6 - languageName: node - linkType: hard - "@jest/types@npm:^29.6.3": version: 29.6.3 resolution: "@jest/types@npm:29.6.3" @@ -2272,73 +2248,63 @@ __metadata: languageName: node linkType: hard -"@testing-library/dom@npm:^7.22.3, @testing-library/dom@npm:^7.30.3": - version: 7.31.2 - resolution: "@testing-library/dom@npm:7.31.2" +"@testing-library/dom@npm:^10.4.0": + version: 10.4.0 + resolution: "@testing-library/dom@npm:10.4.0" dependencies: "@babel/code-frame": ^7.10.4 "@babel/runtime": ^7.12.5 - "@types/aria-query": ^4.2.0 - aria-query: ^4.2.2 + "@types/aria-query": ^5.0.1 + aria-query: 5.3.0 chalk: ^4.1.0 - dom-accessibility-api: ^0.5.6 - lz-string: ^1.4.4 - pretty-format: ^26.6.2 - checksum: 54fbedd1ecdfe1d47be2e592b98d18b2ab9d7e731f57231caf9b152593fe7329fe5ebe219e0e5d1e0df5b1ab803121cb8acd8b73bd1fb292bfdc2c55663eb01d + dom-accessibility-api: ^0.5.9 + lz-string: ^1.5.0 + pretty-format: ^27.0.2 + checksum: bb128b90be0c8cd78c5f5e67aa45f53de614cc048a2b50b230e736ec710805ac6c73375af354b83c74d710b3928d52b83a273a4cb89de4eb3efe49e91e706837 languageName: node linkType: hard -"@testing-library/jest-dom@npm:6.1.4": - version: 6.1.4 - resolution: "@testing-library/jest-dom@npm:6.1.4" +"@testing-library/jest-dom@npm:^6.5.0": + version: 6.5.0 + resolution: "@testing-library/jest-dom@npm:6.5.0" 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 - peerDependencies: - "@jest/globals": ">= 28" - "@types/jest": ">= 28" - jest: ">= 28" - vitest: ">= 0.32" - peerDependenciesMeta: - "@jest/globals": - optional: true - "@types/jest": - optional: true - jest: - optional: true - vitest: - optional: true - checksum: c6bd9469554136a25d94b55ea16736d56b8c5d200526023774dbf35ca35551a721257e6734f1b404bbd07ae0a1950f1912b5be60e113db2ff2ff50af14f7085c + checksum: c2d14103ebe3358852ec527ff7512f64207a39932b2f7b6dff7e73ba91296b01a71bad9a9584b6ee010681380a906c1740af50470adc6db660e1c7585d012ebf languageName: node linkType: hard -"@testing-library/react@npm:^10.3.0": - version: 10.4.9 - resolution: "@testing-library/react@npm:10.4.9" +"@testing-library/react@npm:^16.0.1": + version: 16.0.1 + resolution: "@testing-library/react@npm:16.0.1" dependencies: - "@babel/runtime": ^7.10.3 - "@testing-library/dom": ^7.22.3 + "@babel/runtime": ^7.12.5 peerDependencies: - react: "*" - react-dom: "*" - checksum: bab64c820fd0772689b45b5fd113b67059dd61a1618e4445613df87b64309a2f00d8b70962fb09a45b98047eb8a54f9226ae221cbf3a884f7ebcf1b02f3a2acb + "@testing-library/dom": ^10.0.0 + "@types/react": ^18.0.0 + "@types/react-dom": ^18.0.0 + react: ^18.0.0 + react-dom: ^18.0.0 + peerDependenciesMeta: + "@types/react": + optional: true + "@types/react-dom": + optional: true + checksum: 1837db473ea018cf2b5d0cbfffb7a30d0d759e5a7f23aad431441c77bcc3d2533250cd003a61878fd908267df47404cedcb5914f12d79e413002c659652b37fd languageName: node linkType: hard -"@testing-library/user-event@npm:^12.1": - version: 12.8.3 - resolution: "@testing-library/user-event@npm:12.8.3" - dependencies: - "@babel/runtime": ^7.12.5 +"@testing-library/user-event@npm:^14.5.2": + version: 14.5.2 + resolution: "@testing-library/user-event@npm:14.5.2" peerDependencies: "@testing-library/dom": ">=7.21.4" - checksum: c9fb5ee07cbe79ddf32d81e1a353e556d02a1f1619456ccfad6abcdf1b7db400fdc9d7a8e0be3994f456e7135a0dfb7fa10b29fb98a0f5fc417b99fce0ce8166 + checksum: d76937dffcf0082fbf3bb89eb2b81a31bf5448048dd61c33928c5f10e33a58e035321d39145cefd469bb5a499c68a5b4086b22f1a44e3e7c7e817dc5f6782867 languageName: node linkType: hard @@ -2380,10 +2346,10 @@ __metadata: languageName: node linkType: hard -"@types/aria-query@npm:^4.2.0": - version: 4.2.2 - resolution: "@types/aria-query@npm:4.2.2" - checksum: 6f2ce11d91e2d665f3873258db19da752d91d85d3679eb5efcdf9c711d14492287e1e4eb52613b28e60375841a9e428594e745b68436c963d8bad4bf72188df3 +"@types/aria-query@npm:^5.0.1": + version: 5.0.4 + resolution: "@types/aria-query@npm:5.0.4" + checksum: ad8b87e4ad64255db5f0a73bc2b4da9b146c38a3a8ab4d9306154334e0fc67ae64e76bfa298eebd1e71830591fb15987e5de7111bdb36a2221bdc379e3415fb0 languageName: node linkType: hard @@ -2527,7 +2493,7 @@ __metadata: languageName: node linkType: hard -"@types/jest@npm:*, @types/jest@npm:^29.5.3": +"@types/jest@npm:^29.5.3": version: 29.5.7 resolution: "@types/jest@npm:29.5.7" dependencies: @@ -2697,12 +2663,12 @@ __metadata: languageName: node linkType: hard -"@types/react-test-renderer@npm:^18.0.0": - version: 18.0.5 - resolution: "@types/react-test-renderer@npm:18.0.5" +"@types/react-test-renderer@npm:^18.3.0": + version: 18.3.0 + resolution: "@types/react-test-renderer@npm:18.3.0" dependencies: "@types/react": "*" - checksum: c0932fa6c99dc84df3f8132f728f4fad7aeb05ea667f1524384c083e62b90e3a91107d89d2e91b03bd0ca02cc6bbec8cfe9669c29a8394ae990af549ca16c0a3 + checksum: c53683990bd194cb68e3987bda79c78eff41517f7a747e92f3e54217c2ce3addd031b8a45bf631982c909cc2caeeb905372f322758e05bb76c03754a3f24426e languageName: node linkType: hard @@ -2780,15 +2746,6 @@ __metadata: languageName: node linkType: hard -"@types/testing-library__jest-dom@npm:^5.14.9": - version: 5.14.9 - resolution: "@types/testing-library__jest-dom@npm:5.14.9" - dependencies: - "@types/jest": "*" - checksum: d364494fc2545316292e88861146146af1e3818792ca63b62a63758b2f737669b687f4aaddfcfbcb7d0e1ed7890a9bd05de23ff97f277d5e68de574497a9ee72 - languageName: node - linkType: hard - "@types/tough-cookie@npm:*": version: 4.0.4 resolution: "@types/tough-cookie@npm:4.0.4" @@ -2823,15 +2780,6 @@ __metadata: languageName: node linkType: hard -"@types/yargs@npm:^15.0.0": - version: 15.0.17 - resolution: "@types/yargs@npm:15.0.17" - dependencies: - "@types/yargs-parser": "*" - checksum: b306af8c32ed5eee219d66fb2b302b24460e5551f6df38ac52c26906e2689ac55d64190cf15feec46b380abd0b1994631690d9ffcc7bcd9dd3ff1242740fa5f0 - languageName: node - linkType: hard - "@types/yargs@npm:^17.0.8": version: 17.0.29 resolution: "@types/yargs@npm:17.0.29" @@ -3407,7 +3355,7 @@ __metadata: languageName: node linkType: hard -"ansi-regex@npm:^5.0.0, ansi-regex@npm:^5.0.1": +"ansi-regex@npm:^5.0.1": version: 5.0.1 resolution: "ansi-regex@npm:5.0.1" checksum: 2aa4bb54caf2d622f1afdad09441695af2a83aa3fe8b8afa581d205e57ed4261c183c4d3877cee25794443fde5876417d859c108078ab788d6af7e4fe52eb66b @@ -3522,17 +3470,7 @@ __metadata: languageName: node linkType: hard -"aria-query@npm:^4.2.2": - version: 4.2.2 - resolution: "aria-query@npm:4.2.2" - dependencies: - "@babel/runtime": ^7.10.2 - "@babel/runtime-corejs3": ^7.10.2 - checksum: 38401a9a400f26f3dcc24b84997461a16b32869a9893d323602bed8da40a8bcc0243b8d2880e942249a1496cea7a7de769e93d21c0baa439f01e1ee936fed665 - languageName: node - linkType: hard - -"aria-query@npm:^5.0.0": +"aria-query@npm:5.3.0, aria-query@npm:^5.0.0": version: 5.3.0 resolution: "aria-query@npm:5.3.0" dependencies: @@ -4984,13 +4922,6 @@ __metadata: languageName: node linkType: hard -"core-js-pure@npm:^3.30.2": - version: 3.33.2 - resolution: "core-js-pure@npm:3.33.2" - checksum: 601704482885e94a445b02d8b1e4da72f8f40a6eb54ef2f97e7bd912a9233119372b21a44ca9c7b39cd5597c281cde3a8ac629b696cfdf5ddd93ecda4f5a543f - languageName: node - linkType: hard - "core-js@npm:^2.5.0": version: 2.6.12 resolution: "core-js@npm:2.6.12" @@ -5718,13 +5649,20 @@ __metadata: languageName: node linkType: hard -"dom-accessibility-api@npm:^0.5.6": +"dom-accessibility-api@npm:^0.5.9": version: 0.5.16 resolution: "dom-accessibility-api@npm:0.5.16" checksum: 005eb283caef57fc1adec4d5df4dd49189b628f2f575af45decb210e04d634459e3f1ee64f18b41e2dcf200c844bc1d9279d80807e686a30d69a4756151ad248 languageName: node linkType: hard +"dom-accessibility-api@npm:^0.6.3": + version: 0.6.3 + resolution: "dom-accessibility-api@npm:0.6.3" + checksum: c325b5144bb406df23f4affecffc117dbaec9af03daad9ee6b510c5be647b14d28ef0a4ea5ca06d696d8ab40bb777e5fed98b985976fdef9d8790178fa1d573f + languageName: node + linkType: hard + "dom-converter@npm:^0.2.0": version: 0.2.0 resolution: "dom-converter@npm:0.2.0" @@ -10169,7 +10107,7 @@ __metadata: languageName: node linkType: hard -"lz-string@npm:^1.4.4": +"lz-string@npm:^1.5.0": version: 1.5.0 resolution: "lz-string@npm:1.5.0" bin: @@ -12715,15 +12653,14 @@ __metadata: languageName: node linkType: hard -"pretty-format@npm:^26.6.2": - version: 26.6.2 - resolution: "pretty-format@npm:26.6.2" +"pretty-format@npm:^27.0.2": + version: 27.5.1 + resolution: "pretty-format@npm:27.5.1" dependencies: - "@jest/types": ^26.6.2 - ansi-regex: ^5.0.0 - ansi-styles: ^4.0.0 + ansi-regex: ^5.0.1 + ansi-styles: ^5.0.0 react-is: ^17.0.1 - checksum: e3b808404d7e1519f0df1aa1f25cee0054ab475775c6b2b8c5568ff23194a92d54bf93274139b6f584ca70fd773be4eaa754b0e03f12bb0a8d1426b07f079976 + checksum: cf610cffcb793885d16f184a62162f2dd0df31642d9a18edf4ca298e909a8fe80bdbf556d5c9573992c102ce8bf948691da91bf9739bee0ffb6e79c8a8a6e088 languageName: node linkType: hard @@ -13039,17 +12976,15 @@ __metadata: languageName: node linkType: hard -"react-dom@npm:^16.12.0": - version: 16.14.0 - resolution: "react-dom@npm:16.14.0" +"react-dom@npm:^18.3.1": + version: 18.3.1 + resolution: "react-dom@npm:18.3.1" dependencies: loose-envify: ^1.1.0 - object-assign: ^4.1.1 - prop-types: ^15.6.2 - scheduler: ^0.19.1 + scheduler: ^0.23.2 peerDependencies: - react: ^16.14.0 - checksum: 5a5c49da0f106b2655a69f96c622c347febcd10532db391c262b26aec225b235357d9da1834103457683482ab1b229af7a50f6927a6b70e53150275e31785544 + react: ^18.3.1 + checksum: 298954ecd8f78288dcaece05e88b570014d8f6dce5db6f66e6ee91448debeb59dcd31561dddb354eee47e6c1bb234669459060deb238ed0213497146e555a0b9 languageName: node linkType: hard @@ -13088,7 +13023,14 @@ __metadata: languageName: node linkType: hard -"react-is@npm:^16.13.1, react-is@npm:^16.3.2, react-is@npm:^16.6.0, react-is@npm:^16.7.0, react-is@npm:^16.8.6": +"react-is@npm:^16.12.0 || ^17.0.0 || ^18.0.0, react-is@npm:^18.3.1": + version: 18.3.1 + resolution: "react-is@npm:18.3.1" + checksum: e20fe84c86ff172fc8d898251b7cc2c43645d108bf96d0b8edf39b98f9a2cae97b40520ee7ed8ee0085ccc94736c4886294456033304151c3f94978cec03df21 + languageName: node + linkType: hard + +"react-is@npm:^16.13.1, react-is@npm:^16.3.2, react-is@npm:^16.6.0, react-is@npm:^16.7.0": version: 16.13.1 resolution: "react-is@npm:16.13.1" checksum: f7a19ac3496de32ca9ae12aa030f00f14a3d45374f1ceca0af707c831b2a6098ef0d6bdae51bd437b0a306d7f01d4677fcc8de7c0d331eb47ad0f46130e53c5f @@ -13176,6 +13118,18 @@ __metadata: languageName: node linkType: hard +"react-shallow-renderer@npm:^16.15.0": + version: 16.15.0 + resolution: "react-shallow-renderer@npm:16.15.0" + dependencies: + object-assign: ^4.1.1 + react-is: ^16.12.0 || ^17.0.0 || ^18.0.0 + peerDependencies: + react: ^16.0.0 || ^17.0.0 || ^18.0.0 + checksum: 6052c7e3e9627485120ebd8257f128aad8f56386fe8d42374b7743eac1be457c33506d153c7886b4e32923c0c352d402ab805ef9ca02dbcd8393b2bdeb6e5af8 + languageName: node + linkType: hard + "react-side-effect@npm:^2.1.0": version: 2.1.2 resolution: "react-side-effect@npm:2.1.2" @@ -13185,17 +13139,16 @@ __metadata: languageName: node linkType: hard -"react-test-renderer@npm:^16.14.0": - version: 16.14.0 - resolution: "react-test-renderer@npm:16.14.0" +"react-test-renderer@npm:^18.3.1": + version: 18.3.1 + resolution: "react-test-renderer@npm:18.3.1" dependencies: - object-assign: ^4.1.1 - prop-types: ^15.6.2 - react-is: ^16.8.6 - scheduler: ^0.19.1 + react-is: ^18.3.1 + react-shallow-renderer: ^16.15.0 + scheduler: ^0.23.2 peerDependencies: - react: ^16.14.0 - checksum: 96eb8a2566e67ebd246ef6e1b36d8c8498c68ebfdb94ca8399c19b4e3b73368caf0ffbe44767593e3499f2f58b4b5e57ba0565a47628048d2ab01b23a422724e + react: ^18.3.1 + checksum: e8e58e738835fab3801afb63f6bfe0fcf6e68ea39619fae5bdf47feefc36b1e4acb48c9dd139c7533611466eff1dfce6ffdda4b317e06aee663dda7d91438f26 languageName: node linkType: hard @@ -13212,14 +13165,12 @@ __metadata: languageName: node linkType: hard -"react@npm:^16.14.0": - version: 16.14.0 - resolution: "react@npm:16.14.0" +"react@npm:^18.3.1": + version: 18.3.1 + resolution: "react@npm:18.3.1" dependencies: loose-envify: ^1.1.0 - object-assign: ^4.1.1 - prop-types: ^15.6.2 - checksum: 8484f3ecb13414526f2a7412190575fc134da785c02695eb92bb6028c930bfe1c238d7be2a125088fec663cc7cda0a3623373c46807cf2c281f49c34b79881ac + checksum: a27bcfa8ff7c15a1e50244ad0d0c1cb2ad4375eeffefd266a64889beea6f6b64c4966c9b37d14ee32d6c9fcd5aa6ba183b6988167ab4d127d13e7cb5b386a376 languageName: node linkType: hard @@ -13932,13 +13883,12 @@ __metadata: languageName: node linkType: hard -"scheduler@npm:^0.19.1": - version: 0.19.1 - resolution: "scheduler@npm:0.19.1" +"scheduler@npm:^0.23.2": + version: 0.23.2 + resolution: "scheduler@npm:0.23.2" dependencies: loose-envify: ^1.1.0 - object-assign: ^4.1.1 - checksum: 73e185a59e2ff5aa3609f5b9cb97ddd376f89e1610579d29939d952411ca6eb7a24907a4ea4556569dacb931467a1a4a56d94fe809ef713aa76748642cd96a6c + checksum: 3e82d1f419e240ef6219d794ff29c7ee415fbdc19e038f680a10c067108e06284f1847450a210b29bbaf97b9d8a97ced5f624c31c681248ac84c80d56ad5a2c4 languageName: node linkType: hard