workaround getComputedStyle issues in all jest tests (#14737)
This commit is contained in:
parent
634ec98f11
commit
b7d63a6e8d
2 changed files with 4 additions and 5 deletions
|
|
@ -15,11 +15,6 @@ const organizations = [
|
|||
];
|
||||
|
||||
describe('<OrganizationPicker />', () => {
|
||||
beforeAll(() => {
|
||||
// TODO: Remove this once https://github.com/nickcolley/jest-axe/issues/147 is fixed.
|
||||
window.getComputedStyle = () => {};
|
||||
});
|
||||
|
||||
it('should have no a11y violations', async () => {
|
||||
const { container } = render(
|
||||
<OrganizationPicker
|
||||
|
|
|
|||
|
|
@ -4,6 +4,10 @@ import './app/assets/javascripts/lib/xss';
|
|||
|
||||
global.setImmediate = global.setTimeout;
|
||||
|
||||
// TODO: Remove this once https://github.com/nickcolley/jest-axe/issues/147 is fixed.
|
||||
const { getComputedStyle } = window;
|
||||
window.getComputedStyle = (elt) => getComputedStyle(elt);
|
||||
|
||||
process.on('unhandledRejection', (error) => {
|
||||
// Errors thrown here are typically fetch responses that have not been mocked.
|
||||
throw error;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue