diff --git a/package-lock.json b/package-lock.json index d4a680f08..6eecc6072 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6952,6 +6952,12 @@ "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==" }, + "cssfontparser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/cssfontparser/-/cssfontparser-1.2.1.tgz", + "integrity": "sha512-6tun4LoZnj7VN6YeegOVb67KBX/7JJsqvj+pv3ZA7F878/eN33AbGa5b/S/wXxS/tcp8nc40xRUrsPlxIyNUPg==", + "dev": true + }, "cssom": { "version": "0.5.0", "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.5.0.tgz", @@ -10209,6 +10215,16 @@ } } }, + "jest-canvas-mock": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/jest-canvas-mock/-/jest-canvas-mock-2.4.0.tgz", + "integrity": "sha512-mmMpZzpmLzn5vepIaHk5HoH3Ka4WykbSoLuG/EKoJd0x0ID/t+INo1l8ByfcUJuDM+RIsL4QDg/gDnBbrj2/IQ==", + "dev": true, + "requires": { + "cssfontparser": "^1.2.1", + "moo-color": "^1.0.2" + } + }, "jest-changed-files": { "version": "28.0.2", "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-28.0.2.tgz", @@ -13686,6 +13702,23 @@ "integrity": "sha512-I1mnb5xn4fO80BH9BLcF0yLypy2UKl+Cb01Fu0hJRkJjlCRtxZMWkTdAtDd5ZqCOxtCkhmRwyI57vWT+1iZ67w==", "dev": true }, + "moo-color": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/moo-color/-/moo-color-1.0.3.tgz", + "integrity": "sha512-i/+ZKXMDf6aqYtBhuOcej71YSlbjT3wCO/4H1j8rPvxDJEifdwgg5MaFyu6iYAT8GBZJg2z0dkgK4YMzvURALQ==", + "dev": true, + "requires": { + "color-name": "^1.1.4" + }, + "dependencies": { + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + } + } + }, "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", diff --git a/package.json b/package.json index 30fb8b558..88fad85bb 100644 --- a/package.json +++ b/package.json @@ -110,6 +110,7 @@ "eslint": "8.21.0", "html-webpack-plugin": "5.5.0", "jest": "28.1.0", + "jest-canvas-mock": "2.4.0", "jest-environment-jsdom": "28.1.3", "jest-fetch-mock": "3.0.3", "jest-sonar-reporter": "2.0.0", diff --git a/src/app/views/App.spec.tsx b/src/app/views/App.spec.tsx index d46ced4f8..3b5893135 100644 --- a/src/app/views/App.spec.tsx +++ b/src/app/views/App.spec.tsx @@ -224,7 +224,7 @@ describe('App rendering', () => { it('should render the permissions tab and its children when the modify permissions tab is clicked', async () => { const user = userEvent.setup(); renderApp({mobileScreen: false, showSidebar: true}); - const modifyPermissionsTab = screen.getByRole('tab', { name: /modify permissions \(preview\)/i}); + const modifyPermissionsTab = screen.getByRole('tab', { name: /modify permissions/i }); await user.click(modifyPermissionsTab); expect(screen.getByText(/Permissions for the query are missing on this tab/i)).toBeDefined(); }); diff --git a/src/setupTests.ts b/src/setupTests.ts index 1a87eb45d..a6f8904ea 100644 --- a/src/setupTests.ts +++ b/src/setupTests.ts @@ -1,4 +1,5 @@ import { GlobalWithFetchMock } from 'jest-fetch-mock'; +import 'jest-canvas-mock'; const customGlobal: GlobalWithFetchMock = global as unknown as GlobalWithFetchMock; customGlobal.fetch = require('jest-fetch-mock'); // tslint:disable-line