Skip to content

Commit

Permalink
fix(summary): SKFP-827 add accessibility settings for graph
Browse files Browse the repository at this point in the history
  • Loading branch information
lflangis committed Dec 5, 2023
1 parent cfa7851 commit b8b8c89
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
2 changes: 1 addition & 1 deletion jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export default {
roots: ['<rootDir>/src'],
collectCoverageFrom: ['src/**/*.{js,jsx,ts,tsx}', '!src/**/*.d.ts'],
setupFiles: ['react-app-polyfill/jsdom'],
setupFilesAfterEnv: [],
setupFilesAfterEnv: ['./jest.setup.ts'],
testMatch: [
'<rootDir>/src/**/__tests__/**/*.{js,jsx,ts,tsx}',
'<rootDir>/src/**/*.{spec,test}.{js,jsx,ts,tsx}',
Expand Down
30 changes: 30 additions & 0 deletions jest.setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// react-intl
import intl from 'react-intl-universal';
require('intl/locale-data/jsonp/en.js');

const locales = require('./src/locales/index');
const { LANG } = require('./src/common/constants');
intl.init({ locales: { [LANG.EN]: locales.default.en }, currentLocale: LANG.EN });

// matchmedia fix
Object.defineProperty(window, 'matchMedia', {
value: jest.fn().mockImplementation((query) => ({
// deprecated
addEventListener: jest.fn(),

addListener: jest.fn(),

dispatchEvent: jest.fn(),

matches: false,

media: query,

onchange: null,

removeEventListener: jest.fn(),
// deprecated
removeListener: jest.fn(),
})),
writable: true,
});

0 comments on commit b8b8c89

Please sign in to comment.