Skip to content

Commit

Permalink
feat(PN-10563): remove jest-axe file tests in PA (#1179)
Browse files Browse the repository at this point in the history
* feat(PN-10563): remove jest-axe file tests in PA

* fix(PN-10563): change request: remove jest-axe in pn-commons and dependencies in all components

* chore(PN-10563): remove useless configuration

* fix(PN-10563): remove script comands for a11y

* fix(PN-10563): install jest on pn-commons

* fix(PN-10563): restore PF file

* fix(PN-10563): restore PG files

* fix(PN-10563): add jest dependency
  • Loading branch information
SarahDonvito authored Apr 15, 2024
1 parent 32d7b6e commit 5fb74fb
Show file tree
Hide file tree
Showing 19 changed files with 212 additions and 741 deletions.
2 changes: 1 addition & 1 deletion packages/pn-commons/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
"build": "tsc -p tsconfig.prod.json",
"test": "tsc --noEmit && vitest --run",
"test:fast": "vitest --run",
"test:a11y": "vitest --run --config ./vite.config.a11y.ts",
"test:all": "vitest --run --config ./vite.config.all.ts",
"test:coverage": "tsc --noEmit && vitest run --coverage",
"lint": "eslint . -c .eslintrc.js --ext .ts,.tsx --fix",
Expand Down Expand Up @@ -62,6 +61,7 @@
"@testing-library/user-event": "^14.5.1",
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
"@types/css-mediaquery": "^0.1.1",
"@types/jest": "^29.5.12",
"@typescript-eslint/eslint-plugin": "^6.7.3",
"@typescript-eslint/parser": "^6.7.3",
"@vitejs/plugin-react": "^4.2.1",
Expand Down

This file was deleted.

This file was deleted.

18 changes: 0 additions & 18 deletions packages/pn-commons/vite.config.a11y.ts

This file was deleted.

3 changes: 1 addition & 2 deletions packages/pn-commons/vite.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,12 @@ const vitestConfig = defineVitestConfig({
globals: true,
setupFiles: './src/setupTests.ts',
environment: 'jsdom',
exclude: [...configDefaults.exclude, '**/*.a11y.test.ts', '**/*.a11y.test.tsx'],
exclude: configDefaults.exclude,
reporters: ['vitest-sonar-reporter', 'default'],
outputFile: 'test-report.xml',
coverage: {
provider: 'v8',
reporter: ['lcov'],
exclude: ['**/*.a11y.test.ts', '**/*.a11y.test.tsx'],
reportOnFailure: true,
},
},
Expand Down
4 changes: 1 addition & 3 deletions packages/pn-pa-webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
"preview": "vite preview",
"test": "tsc && vitest --run",
"test:fast": "vitest --run",
"test:a11y": "vitest --run --config ./vite.config.a11y.ts",
"test:all": "vitest --run --config ./vite.config.all.ts",
"test:coverage": "tsc && vitest run --coverage",
"lint": "eslint . -c .eslintrc.js --ext .ts,.tsx --fix",
Expand Down Expand Up @@ -69,7 +68,7 @@
"@testing-library/react": "^14.0.0",
"@testing-library/user-event": "^14.5.1",
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
"@types/jest-axe": "^3.5.3",
"@types/jest": "^29.5.12",
"@types/mixpanel-browser": "^2.38.0",
"@typescript-eslint/eslint-plugin": "^6.7.3",
"@typescript-eslint/parser": "^6.7.3",
Expand All @@ -84,7 +83,6 @@
"eslint-plugin-react": "^7.27.1",
"eslint-plugin-react-hooks": "^4.3.0",
"eslint-plugin-sonarjs": "^0.10.0",
"jest-axe": "^6.0.0",
"jsdom": "^24.0.0",
"prettier": "^2.4.1",
"sonarqube-scanner": "^3.3.0",
Expand Down
120 changes: 0 additions & 120 deletions packages/pn-pa-webapp/src/__test__/App.a11y.test.tsx

This file was deleted.

10 changes: 0 additions & 10 deletions packages/pn-pa-webapp/src/__test__/test-utils.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { configureAxe, toHaveNoViolations } from 'jest-axe';
import { ReactElement, ReactNode } from 'react';
import { Provider } from 'react-redux';
import { BrowserRouter } from 'react-router-dom';
Expand Down Expand Up @@ -37,12 +36,6 @@ const customRender = (
});
};

const axe = configureAxe({
rules: {
region: { enabled: false },
},
});

// utility functions
/**
* Generate a random string with specified length
Expand All @@ -57,10 +50,7 @@ function randomString(length: number) {
return result;
}

expect.extend(toHaveNoViolations);

export * from '@testing-library/react';
export { customRender as render, testStore };
export { axe };
// utility functions
export { randomString };

This file was deleted.

Loading

0 comments on commit 5fb74fb

Please sign in to comment.