From 661b8d595c8277161c276f35b907514d2d83cd62 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Thu, 24 Mar 2022 20:37:52 -0600 Subject: [PATCH] Step 8.7: Introduce `focus-visible` import where needed to repair tests There is an import in `MatrixChat` which no longer gets executed when we don't skin the entire app, so bring it in manually. --- src/components/structures/MatrixChat.tsx | 2 +- test/components/structures/ThreadPanel-test.tsx | 1 + test/components/views/context_menus/SpaceContextMenu-test.tsx | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/structures/MatrixChat.tsx b/src/components/structures/MatrixChat.tsx index 56c41739dd..01b3f4cd07 100644 --- a/src/components/structures/MatrixChat.tsx +++ b/src/components/structures/MatrixChat.tsx @@ -32,7 +32,7 @@ import { logger } from "matrix-js-sdk/src/logger"; import { throttle } from "lodash"; import { CryptoEvent } from "matrix-js-sdk/src/crypto"; -// focus-visible is a Polyfill for the :focus-visible CSS pseudo-attribute used by _AccessibleButton.scss +// focus-visible is a Polyfill for the :focus-visible CSS pseudo-attribute used by various components import 'focus-visible'; // what-input helps improve keyboard accessibility import 'what-input'; diff --git a/test/components/structures/ThreadPanel-test.tsx b/test/components/structures/ThreadPanel-test.tsx index 24616cca1a..6a2a65a9ee 100644 --- a/test/components/structures/ThreadPanel-test.tsx +++ b/test/components/structures/ThreadPanel-test.tsx @@ -16,6 +16,7 @@ limitations under the License. import React from 'react'; import { shallow, mount } from "enzyme"; +import 'focus-visible'; // to fix context menus import { ThreadFilterType, diff --git a/test/components/views/context_menus/SpaceContextMenu-test.tsx b/test/components/views/context_menus/SpaceContextMenu-test.tsx index 53b762ef86..4dff077f0f 100644 --- a/test/components/views/context_menus/SpaceContextMenu-test.tsx +++ b/test/components/views/context_menus/SpaceContextMenu-test.tsx @@ -19,6 +19,7 @@ import { mount } from 'enzyme'; import { Room } from 'matrix-js-sdk/src/matrix'; import { mocked } from 'jest-mock'; import { act } from 'react-dom/test-utils'; +import 'focus-visible'; // to fix context menus import SpaceContextMenu from '../../../../src/components/views/context_menus/SpaceContextMenu'; import MatrixClientContext from '../../../../src/contexts/MatrixClientContext';