Skip to content

Commit

Permalink
fix: colocate button test
Browse files Browse the repository at this point in the history
  • Loading branch information
anastasialanz committed Jan 4, 2024
1 parent e2d8742 commit 0a7e352
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 11 deletions.
6 changes: 3 additions & 3 deletions packages/react/__tests__/axe.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { configureAxe } from 'jest-axe';
import { JestAxe, configureAxe } from 'jest-axe';

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

module.exports = axe;
export default axe;
File renamed without changes.
7 changes: 4 additions & 3 deletions packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"@types/react": "^18.0.12",
"@types/react-dom": "^18.0.5",
"@types/jest-axe": "^3.5.4",
"@types/jest": "^24.7.1",
"@types/react-syntax-highlighter": "^15.5.2",
"autoprefixer": "^9.7.6",
"babel-plugin-module-resolver": "^4.0.0",
Expand Down Expand Up @@ -95,12 +96,12 @@
},
"jest": {
"setupFilesAfterEnv": [
"<rootDir>__tests__/setupTests.js"
"<rootDir>__tests__/setupTests.ts"
],
"testMatch": [
"**/__tests__/src/**/*.js",
"**/__tests__/src/**/*.tsx",
"**/__tests__/demo/**/*.js"
"**/__tests__/demo/**/*.js",
"**/src/components/**/*.test.tsx"
],
"collectCoverageFrom": [
"**/src/**/*.{ts,tsx}"
Expand Down
9 changes: 9 additions & 0 deletions packages/react/src/axe.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { JestAxe, configureAxe } from 'jest-axe';

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

export default axe;
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from 'react';
import { render, screen } from '@testing-library/react';
import Button from '../../../../src/components/Button';
import Icon from '../../../../src/components/Icon';
import * as axe from '../../../axe';
import Button from '../../../src/components/Button';
import Icon from '../../../src/components/Icon';
import axe from '../../axe';

test('should render primary button', () => {
render(
Expand Down
11 changes: 9 additions & 2 deletions packages/react/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1702,6 +1702,13 @@
expect "^29.0.0"
pretty-format "^29.0.0"

"@types/jest@^24.7.1":
version "24.9.1"
resolved "https://registry.yarnpkg.com/@types/jest/-/jest-24.9.1.tgz#02baf9573c78f1b9974a5f36778b366aa77bd534"
integrity sha512-Fb38HkXSVA4L8fGKEZ6le5bB8r6MRWlOCZbVuWZcmOMSCd2wCYOwN1ibj8daIoV9naq7aaOZjrLCoCMptKU/4Q==
dependencies:
jest-diff "^24.3.0"

"@types/node@*":
version "20.10.6"
resolved "https://registry.yarnpkg.com/@types/node/-/node-20.10.6.tgz#a3ec84c22965802bf763da55b2394424f22bfbb5"
Expand Down Expand Up @@ -4421,9 +4428,9 @@ jest-config@^24.9.0:
pretty-format "^24.9.0"
realpath-native "^1.1.0"

jest-diff@^24.9.0:
jest-diff@^24.3.0, jest-diff@^24.9.0:
version "24.9.0"
resolved "https://registry.npmjs.org/jest-diff/-/jest-diff-24.9.0.tgz"
resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-24.9.0.tgz#931b7d0d5778a1baf7452cb816e325e3724055da"
integrity sha512-qMfrTs8AdJE2iqrTp0hzh7kTd2PQWrsFyj9tORoKmu32xjPjeE4NyjVRDz8ybYwqS2ik8N4hsIpiVTyFeo2lBQ==
dependencies:
chalk "^2.0.1"
Expand Down

0 comments on commit 0a7e352

Please sign in to comment.