From a987ead7d2cc6708fe42eff9bd8beee1381a2de4 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Tue, 22 Mar 2022 23:22:53 -0600 Subject: [PATCH] Step 8.1: Remove skinning setup from all tests --- scripts/make-react-component.js | 10 ++----- test/CallHandler-test.ts | 2 -- test/DecryptionFailureTracker-test.js | 1 - test/DeviceListener-test.ts | 1 - test/Image-test.ts | 1 - test/Reply-test.ts | 1 - test/TextForEvent-test.ts | 2 -- test/accessibility/RovingTabIndex-test.tsx | 1 - test/audio/Playback-test.ts | 2 -- .../structures/CallEventGrouper-test.ts | 1 - .../components/structures/RightPanel-test.tsx | 2 -- .../structures/ThreadPanel-test.tsx | 1 - .../audio_messages/RecordingPlayback-test.tsx | 1 - .../views/context_menus/ContextMenu-test.tsx | 1 - .../context_menus/MessageContextMenu-test.tsx | 1 - .../context_menus/SpaceContextMenu-test.tsx | 1 - .../views/dialogs/ExportDialog-test.tsx | 1 - .../views/dialogs/ForwardDialog-test.js | 2 -- .../views/elements/AppTile-test.tsx | 2 -- .../views/elements/InteractiveTooltip-test.ts | 1 - .../views/elements/PollCreateDialog-test.tsx | 2 -- .../views/elements/ReplyChain-test.tsx | 1 - .../views/elements/StyledRadioGroup-test.tsx | 1 - .../views/elements/TooltipTarget-test.tsx | 2 -- .../views/location/LocationPicker-test.tsx | 1 - .../views/location/LocationShareMenu-test.tsx | 1 - .../MKeyVerificationConclusion-test.js | 1 - .../views/right_panel/UserInfo-test.tsx | 1 - .../views/rooms/MemberList-test.tsx | 2 -- .../views/rooms/RoomHeader-test.tsx | 1 - .../views/rooms/RoomPreviewBar-test.tsx | 1 - .../views/rooms/SendMessageComposer-test.tsx | 1 - .../views/settings/CryptographyPanel-test.tsx | 2 -- .../views/settings/FontScalingPanel-test.tsx | 1 - .../views/settings/Notifications-test.tsx | 1 - .../views/settings/ThemeChoicePanel-test.tsx | 1 - .../views/spaces/QuickThemeSwitcher-test.tsx | 1 - .../views/spaces/SpacePanel-test.tsx | 1 - .../SpaceSettingsVisibilityTab-test.tsx | 2 -- test/createRoom-test.js | 1 - test/editor/caret-test.js | 1 - test/editor/deserialize-test.js | 1 - test/editor/model-test.js | 1 - test/editor/operations-test.js | 1 - test/editor/position-test.js | 1 - test/editor/range-test.js | 1 - test/editor/serialize-test.js | 1 - test/minimal-sdk.js | 29 ------------------- test/skinned-sdk.js | 28 ------------------ test/stores/RoomViewStore-test.js | 1 - test/stores/SpaceStore-test.ts | 1 - test/stores/VoiceChannelStore-test.ts | 1 - test/stores/VoiceRecordingStore-test.ts | 1 - test/stores/WidgetLayoutStore-test.ts | 1 - .../RoomNotificationState-test.ts | 1 - test/stores/room-list/SpaceWatcher-test.ts | 1 - test/utils/export-test.tsx | 1 - 57 files changed, 3 insertions(+), 129 deletions(-) delete mode 100644 test/minimal-sdk.js delete mode 100644 test/skinned-sdk.js diff --git a/scripts/make-react-component.js b/scripts/make-react-component.js index 063914fafe..56616c3350 100755 --- a/scripts/make-react-component.js +++ b/scripts/make-react-component.js @@ -6,7 +6,7 @@ const path = require('path'); * Unsophisticated script to create a styled, unit-tested react component. * -filePath / -f : path to the component to be created, including new component name, excluding extension, relative to src * -withStyle / -s : optional, flag to create a style file for the component. Defaults to false. - * + * * eg: * ``` * node srcipts/make-react-component.js -f components/toasts/NewToast -s @@ -15,7 +15,7 @@ const path = require('path'); * - src/components/toasts/NewToast.tsx * - test/components/toasts/NewToast-test.tsx * - res/css/components/toasts/_NewToast.scss - * + * */ const TEMPLATES = { @@ -34,7 +34,6 @@ export default %%ComponentName%%; import React from 'react'; import { mount } from 'enzyme'; -import '%%SkinnedSdkPath%%'; import %%ComponentName%% from '%%RelativeComponentPath%%'; describe('<%%ComponentName%% />', () => { @@ -85,10 +84,8 @@ const makeFile = async ({ const relativePathToComponent = path.parse(path.relative(path.dirname(newFilePath), componentFilePath || '')); const importComponentPath = path.join(relativePathToComponent.dir, relativePathToComponent.name); - const skinnedSdkPath = path.relative(path.dirname(newFilePath), 'test/skinned-sdk') - try { - await fs.writeFile(newFilePath, fillTemplate(template, componentName, importComponentPath, skinnedSdkPath), { flag: 'wx' }); + await fs.writeFile(newFilePath, fillTemplate(template, componentName, importComponentPath), { flag: 'wx' }); console.log(`Created ${path.relative(process.cwd(), newFilePath)}`); return newFilePath; } catch (error) { @@ -104,7 +101,6 @@ const makeFile = async ({ const fillTemplate = (template, componentName, relativeComponentFilePath, skinnedSdkPath) => template.replace(/%%ComponentName%%/g, componentName) .replace(/%%RelativeComponentPath%%/g, relativeComponentFilePath) - .replace(/%%SkinnedSdkPath%%/g, skinnedSdkPath) const makeReactComponent = async () => { diff --git a/test/CallHandler-test.ts b/test/CallHandler-test.ts index 53d341a6f4..01c1085032 100644 --- a/test/CallHandler-test.ts +++ b/test/CallHandler-test.ts @@ -14,8 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. */ -import './skinned-sdk'; - import { IProtocol } from 'matrix-js-sdk/src/matrix'; import { CallEvent, CallState, CallType } from 'matrix-js-sdk/src/webrtc/call'; import EventEmitter from 'events'; diff --git a/test/DecryptionFailureTracker-test.js b/test/DecryptionFailureTracker-test.js index 430cb80e50..b0494f97aa 100644 --- a/test/DecryptionFailureTracker-test.js +++ b/test/DecryptionFailureTracker-test.js @@ -16,7 +16,6 @@ limitations under the License. import { MatrixEvent } from 'matrix-js-sdk/src/matrix'; -import './skinned-sdk'; // Must be first for skinning to work import { DecryptionFailureTracker } from '../src/DecryptionFailureTracker'; class MockDecryptionError extends Error { diff --git a/test/DeviceListener-test.ts b/test/DeviceListener-test.ts index 957e622b35..0640567441 100644 --- a/test/DeviceListener-test.ts +++ b/test/DeviceListener-test.ts @@ -19,7 +19,6 @@ import { EventEmitter } from "events"; import { mocked } from "jest-mock"; import { Room } from "matrix-js-sdk/src/matrix"; -import './skinned-sdk'; import DeviceListener from "../src/DeviceListener"; import { MatrixClientPeg } from "../src/MatrixClientPeg"; import * as SetupEncryptionToast from "../src/toasts/SetupEncryptionToast"; diff --git a/test/Image-test.ts b/test/Image-test.ts index 41a63eb0ce..6352cf8a18 100644 --- a/test/Image-test.ts +++ b/test/Image-test.ts @@ -17,7 +17,6 @@ limitations under the License. import fs from "fs"; import path from "path"; -import './skinned-sdk'; import { blobIsAnimated, mayBeAnimated } from "../src/utils/Image"; describe("Image", () => { diff --git a/test/Reply-test.ts b/test/Reply-test.ts index 54863341cc..a485ee5ab0 100644 --- a/test/Reply-test.ts +++ b/test/Reply-test.ts @@ -14,7 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. */ -import './skinned-sdk'; import { getNestedReplyText, getParentEventId, diff --git a/test/TextForEvent-test.ts b/test/TextForEvent-test.ts index 749dc8d113..75b54aeb66 100644 --- a/test/TextForEvent-test.ts +++ b/test/TextForEvent-test.ts @@ -1,5 +1,3 @@ -import './skinned-sdk'; - import { EventType, MatrixEvent } from "matrix-js-sdk/src/matrix"; import TestRenderer from 'react-test-renderer'; diff --git a/test/accessibility/RovingTabIndex-test.tsx b/test/accessibility/RovingTabIndex-test.tsx index e487098e10..fc1c48f041 100644 --- a/test/accessibility/RovingTabIndex-test.tsx +++ b/test/accessibility/RovingTabIndex-test.tsx @@ -14,7 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. */ -import '../skinned-sdk'; // Must be first for skinning to work import * as React from "react"; import { mount, ReactWrapper } from "enzyme"; diff --git a/test/audio/Playback-test.ts b/test/audio/Playback-test.ts index 7d9a7633b2..a1637d75be 100644 --- a/test/audio/Playback-test.ts +++ b/test/audio/Playback-test.ts @@ -17,8 +17,6 @@ limitations under the License. import { mocked } from 'jest-mock'; import { logger } from 'matrix-js-sdk/src/logger'; -import '../skinned-sdk'; // Must be first for skinning to work - import { createAudioContext, decodeOgg } from '../../src/audio/compat'; import { Playback, PlaybackState } from "../../src/audio/Playback"; diff --git a/test/components/structures/CallEventGrouper-test.ts b/test/components/structures/CallEventGrouper-test.ts index a5c2bb4c16..5cd3a273c6 100644 --- a/test/components/structures/CallEventGrouper-test.ts +++ b/test/components/structures/CallEventGrouper-test.ts @@ -14,7 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. */ -import "../../skinned-sdk"; import { MatrixClient, MatrixEvent } from 'matrix-js-sdk/src/matrix'; import { EventType } from "matrix-js-sdk/src/@types/event"; import { CallState } from "matrix-js-sdk/src/webrtc/call"; diff --git a/test/components/structures/RightPanel-test.tsx b/test/components/structures/RightPanel-test.tsx index 4ae120978f..7d68d1753d 100644 --- a/test/components/structures/RightPanel-test.tsx +++ b/test/components/structures/RightPanel-test.tsx @@ -19,8 +19,6 @@ import TestRenderer from "react-test-renderer"; import { jest } from "@jest/globals"; import { Room } from "matrix-js-sdk/src/models/room"; -// We can't use the usual `skinned-sdk`, as it stubs out the RightPanel -import "../../minimal-sdk"; import RightPanel from "../../../src/components/structures/RightPanel"; import { MatrixClientPeg } from "../../../src/MatrixClientPeg"; import ResizeNotifier from "../../../src/utils/ResizeNotifier"; diff --git a/test/components/structures/ThreadPanel-test.tsx b/test/components/structures/ThreadPanel-test.tsx index aaee488409..24616cca1a 100644 --- a/test/components/structures/ThreadPanel-test.tsx +++ b/test/components/structures/ThreadPanel-test.tsx @@ -16,7 +16,6 @@ limitations under the License. import React from 'react'; import { shallow, mount } from "enzyme"; -import '../../skinned-sdk'; import { ThreadFilterType, diff --git a/test/components/views/audio_messages/RecordingPlayback-test.tsx b/test/components/views/audio_messages/RecordingPlayback-test.tsx index f8a6c0ef92..6a75939bcd 100644 --- a/test/components/views/audio_messages/RecordingPlayback-test.tsx +++ b/test/components/views/audio_messages/RecordingPlayback-test.tsx @@ -20,7 +20,6 @@ import { mocked } from 'jest-mock'; import { logger } from 'matrix-js-sdk/src/logger'; import { act } from 'react-dom/test-utils'; -import '../../../skinned-sdk'; import RecordingPlayback from '../../../../src/components/views/audio_messages/RecordingPlayback'; import { Playback } from '../../../../src/audio/Playback'; import RoomContext, { TimelineRenderingType } from '../../../../src/contexts/RoomContext'; diff --git a/test/components/views/context_menus/ContextMenu-test.tsx b/test/components/views/context_menus/ContextMenu-test.tsx index 3ea0fbac55..46dbbe31fe 100644 --- a/test/components/views/context_menus/ContextMenu-test.tsx +++ b/test/components/views/context_menus/ContextMenu-test.tsx @@ -17,7 +17,6 @@ limitations under the License. import React from "react"; import { mount } from "enzyme"; -import "../../../skinned-sdk"; import ContextMenu, { ChevronFace } from "../../../../src/components/structures/ContextMenu"; import UIStore from "../../../../src/stores/UIStore"; diff --git a/test/components/views/context_menus/MessageContextMenu-test.tsx b/test/components/views/context_menus/MessageContextMenu-test.tsx index 5755a7d280..567e54b418 100644 --- a/test/components/views/context_menus/MessageContextMenu-test.tsx +++ b/test/components/views/context_menus/MessageContextMenu-test.tsx @@ -21,7 +21,6 @@ import { Room } from 'matrix-js-sdk/src/models/room'; import { PendingEventOrdering } from 'matrix-js-sdk/src/matrix'; import { ExtensibleEvent, MessageEvent, M_POLL_KIND_DISCLOSED, PollStartEvent } from 'matrix-events-sdk'; -import '../../../skinned-sdk'; import * as TestUtils from '../../../test-utils'; import MessageContextMenu from '../../../../src/components/views/context_menus/MessageContextMenu'; import { MatrixClientPeg } from '../../../../src/MatrixClientPeg'; diff --git a/test/components/views/context_menus/SpaceContextMenu-test.tsx b/test/components/views/context_menus/SpaceContextMenu-test.tsx index fd0fdb682b..5288c57ec6 100644 --- a/test/components/views/context_menus/SpaceContextMenu-test.tsx +++ b/test/components/views/context_menus/SpaceContextMenu-test.tsx @@ -20,7 +20,6 @@ import { Room } from 'matrix-js-sdk/src/matrix'; import { mocked } from 'jest-mock'; import { act } from 'react-dom/test-utils'; -import '../../../skinned-sdk'; import SpaceContextMenu from '../../../../src/components/views/context_menus/SpaceContextMenu'; import MatrixClientContext from '../../../../src/contexts/MatrixClientContext'; import { findByTestId } from '../../../test-utils'; diff --git a/test/components/views/dialogs/ExportDialog-test.tsx b/test/components/views/dialogs/ExportDialog-test.tsx index 252acc7526..a23c719717 100644 --- a/test/components/views/dialogs/ExportDialog-test.tsx +++ b/test/components/views/dialogs/ExportDialog-test.tsx @@ -20,7 +20,6 @@ import { mocked } from 'jest-mock'; import { act } from "react-dom/test-utils"; import { Room } from 'matrix-js-sdk/src/matrix'; -import '../../../skinned-sdk'; import ExportDialog from '../../../../src/components/views/dialogs/ExportDialog'; import { ExportType, ExportFormat } from '../../../../src/utils/exportUtils/exportUtils'; import { createTestClient, mkStubRoom } from '../../../test-utils'; diff --git a/test/components/views/dialogs/ForwardDialog-test.js b/test/components/views/dialogs/ForwardDialog-test.js index 2d26015079..835f73bbf6 100644 --- a/test/components/views/dialogs/ForwardDialog-test.js +++ b/test/components/views/dialogs/ForwardDialog-test.js @@ -14,8 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. */ -import "../../../skinned-sdk"; - import React from "react"; import { mount } from "enzyme"; import { act } from "react-dom/test-utils"; diff --git a/test/components/views/elements/AppTile-test.tsx b/test/components/views/elements/AppTile-test.tsx index 7f035131a3..8843a9c602 100644 --- a/test/components/views/elements/AppTile-test.tsx +++ b/test/components/views/elements/AppTile-test.tsx @@ -20,8 +20,6 @@ import { jest } from "@jest/globals"; import { Room } from "matrix-js-sdk/src/models/room"; import { MatrixWidgetType } from "matrix-widget-api"; -// We can't use the usual `skinned-sdk`, as it stubs out the RightPanel -import "../../../minimal-sdk"; import RightPanel from "../../../../src/components/structures/RightPanel"; import { MatrixClientPeg } from "../../../../src/MatrixClientPeg"; import ResizeNotifier from "../../../../src/utils/ResizeNotifier"; diff --git a/test/components/views/elements/InteractiveTooltip-test.ts b/test/components/views/elements/InteractiveTooltip-test.ts index fcf3da8eb5..68efca41bd 100644 --- a/test/components/views/elements/InteractiveTooltip-test.ts +++ b/test/components/views/elements/InteractiveTooltip-test.ts @@ -14,7 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. */ -import '../../../skinned-sdk'; import { Direction, mouseWithinRegion } from "../../../../src/components/views/elements/InteractiveTooltip"; describe("InteractiveTooltip", () => { diff --git a/test/components/views/elements/PollCreateDialog-test.tsx b/test/components/views/elements/PollCreateDialog-test.tsx index 779b68e16b..41d2591b64 100644 --- a/test/components/views/elements/PollCreateDialog-test.tsx +++ b/test/components/views/elements/PollCreateDialog-test.tsx @@ -14,8 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. */ -// skinned-sdk should be the first import in most tests -import '../../../skinned-sdk'; import React from "react"; import { mount, ReactWrapper } from "enzyme"; import { Room } from "matrix-js-sdk/src/models/room"; diff --git a/test/components/views/elements/ReplyChain-test.tsx b/test/components/views/elements/ReplyChain-test.tsx index 955f321b5b..bcc33c1fed 100644 --- a/test/components/views/elements/ReplyChain-test.tsx +++ b/test/components/views/elements/ReplyChain-test.tsx @@ -14,7 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. */ -import "../../../skinned-sdk"; import * as testUtils from '../../../test-utils'; import { getParentEventId } from "../../../../src/utils/Reply"; diff --git a/test/components/views/elements/StyledRadioGroup-test.tsx b/test/components/views/elements/StyledRadioGroup-test.tsx index b82920b92b..d567be3394 100644 --- a/test/components/views/elements/StyledRadioGroup-test.tsx +++ b/test/components/views/elements/StyledRadioGroup-test.tsx @@ -13,7 +13,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -import "../../../skinned-sdk"; import React from 'react'; import { mount } from 'enzyme'; diff --git a/test/components/views/elements/TooltipTarget-test.tsx b/test/components/views/elements/TooltipTarget-test.tsx index cdb550a6d0..cf7657bc40 100644 --- a/test/components/views/elements/TooltipTarget-test.tsx +++ b/test/components/views/elements/TooltipTarget-test.tsx @@ -1,5 +1,3 @@ -// skinned-sdk should be the first import in most tests -import '../../../skinned-sdk'; import React from "react"; import { renderIntoDocument, diff --git a/test/components/views/location/LocationPicker-test.tsx b/test/components/views/location/LocationPicker-test.tsx index ac8c6da238..f9b8255736 100644 --- a/test/components/views/location/LocationPicker-test.tsx +++ b/test/components/views/location/LocationPicker-test.tsx @@ -23,7 +23,6 @@ import { MatrixClient } from 'matrix-js-sdk/src/client'; import { mocked } from 'jest-mock'; import { logger } from 'matrix-js-sdk/src/logger'; -import "../../../skinned-sdk"; // Must be first for skinning to work import LocationPicker from "../../../../src/components/views/location/LocationPicker"; import { LocationShareType } from "../../../../src/components/views/location/shareLocation"; import MatrixClientContext from '../../../../src/contexts/MatrixClientContext'; diff --git a/test/components/views/location/LocationShareMenu-test.tsx b/test/components/views/location/LocationShareMenu-test.tsx index b79d6936ba..901e6c0852 100644 --- a/test/components/views/location/LocationShareMenu-test.tsx +++ b/test/components/views/location/LocationShareMenu-test.tsx @@ -24,7 +24,6 @@ import { M_BEACON_INFO } from 'matrix-js-sdk/src/@types/beacon'; import { M_ASSET, LocationAssetType } from 'matrix-js-sdk/src/@types/location'; import { logger } from 'matrix-js-sdk/src/logger'; -import '../../../skinned-sdk'; import LocationShareMenu from '../../../../src/components/views/location/LocationShareMenu'; import MatrixClientContext from '../../../../src/contexts/MatrixClientContext'; import { ChevronFace } from '../../../../src/components/structures/ContextMenu'; diff --git a/test/components/views/messages/MKeyVerificationConclusion-test.js b/test/components/views/messages/MKeyVerificationConclusion-test.js index 025dc82d45..ade7f644f9 100644 --- a/test/components/views/messages/MKeyVerificationConclusion-test.js +++ b/test/components/views/messages/MKeyVerificationConclusion-test.js @@ -1,4 +1,3 @@ -import '../../../skinned-sdk'; // Must be first for skinning to work import React from 'react'; import TestRenderer from 'react-test-renderer'; import { EventEmitter } from 'events'; diff --git a/test/components/views/right_panel/UserInfo-test.tsx b/test/components/views/right_panel/UserInfo-test.tsx index c834f77db4..9966a994c4 100644 --- a/test/components/views/right_panel/UserInfo-test.tsx +++ b/test/components/views/right_panel/UserInfo-test.tsx @@ -21,7 +21,6 @@ import { act } from "react-dom/test-utils"; import { Room, User, MatrixClient } from 'matrix-js-sdk/src/matrix'; import { Phase, VerificationRequest } from 'matrix-js-sdk/src/crypto/verification/request/VerificationRequest'; -import "../../../skinned-sdk"; import UserInfo from '../../../../src/components/views/right_panel/UserInfo'; import { RightPanelPhases } from '../../../../src/stores/right-panel/RightPanelStorePhases'; import { MatrixClientPeg } from '../../../../src/MatrixClientPeg'; diff --git a/test/components/views/rooms/MemberList-test.tsx b/test/components/views/rooms/MemberList-test.tsx index b65ef052ff..a542fe1aac 100644 --- a/test/components/views/rooms/MemberList-test.tsx +++ b/test/components/views/rooms/MemberList-test.tsx @@ -14,8 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. */ -import "../../../skinned-sdk"; - import React from 'react'; import ReactTestUtils from 'react-dom/test-utils'; import ReactDOM from 'react-dom'; diff --git a/test/components/views/rooms/RoomHeader-test.tsx b/test/components/views/rooms/RoomHeader-test.tsx index 889dcc255c..c8030ad7c9 100644 --- a/test/components/views/rooms/RoomHeader-test.tsx +++ b/test/components/views/rooms/RoomHeader-test.tsx @@ -2,7 +2,6 @@ import React from 'react'; import { mount, ReactWrapper } from 'enzyme'; import { Room, PendingEventOrdering, MatrixEvent, MatrixClient } from 'matrix-js-sdk/src/matrix'; -import "../../../skinned-sdk"; import * as TestUtils from '../../../test-utils'; import { MatrixClientPeg } from '../../../../src/MatrixClientPeg'; import DMRoomMap from '../../../../src/utils/DMRoomMap'; diff --git a/test/components/views/rooms/RoomPreviewBar-test.tsx b/test/components/views/rooms/RoomPreviewBar-test.tsx index 132b0e1cc9..d41b4a338a 100644 --- a/test/components/views/rooms/RoomPreviewBar-test.tsx +++ b/test/components/views/rooms/RoomPreviewBar-test.tsx @@ -23,7 +23,6 @@ import { } from 'react-dom/test-utils'; import { Room, RoomMember, MatrixError, IContent } from 'matrix-js-sdk/src/matrix'; -import "../../../skinned-sdk"; import { stubClient } from '../../../test-utils'; import { MatrixClientPeg } from '../../../../src/MatrixClientPeg'; import DMRoomMap from '../../../../src/utils/DMRoomMap'; diff --git a/test/components/views/rooms/SendMessageComposer-test.tsx b/test/components/views/rooms/SendMessageComposer-test.tsx index d2f54c3358..30ecd31586 100644 --- a/test/components/views/rooms/SendMessageComposer-test.tsx +++ b/test/components/views/rooms/SendMessageComposer-test.tsx @@ -20,7 +20,6 @@ import { sleep } from "matrix-js-sdk/src/utils"; import { MatrixClient } from "matrix-js-sdk/src/matrix"; import { mount } from 'enzyme'; -import '../../../skinned-sdk'; // Must be first for skinning to work import SendMessageComposer, { createMessageContent, isQuickReaction, diff --git a/test/components/views/settings/CryptographyPanel-test.tsx b/test/components/views/settings/CryptographyPanel-test.tsx index c3bf816bd7..6748d6858f 100644 --- a/test/components/views/settings/CryptographyPanel-test.tsx +++ b/test/components/views/settings/CryptographyPanel-test.tsx @@ -1,5 +1,3 @@ -import '../../../skinned-sdk'; - import React, { ReactElement } from 'react'; import ReactDOM from 'react-dom'; import { MatrixClient } from 'matrix-js-sdk/src/matrix'; diff --git a/test/components/views/settings/FontScalingPanel-test.tsx b/test/components/views/settings/FontScalingPanel-test.tsx index 84f5cd0945..f18830b348 100644 --- a/test/components/views/settings/FontScalingPanel-test.tsx +++ b/test/components/views/settings/FontScalingPanel-test.tsx @@ -17,7 +17,6 @@ limitations under the License. import React from 'react'; import { mount } from "enzyme"; -import '../../../skinned-sdk'; import * as TestUtils from "../../../test-utils"; import FontScalingPanel from '../../../../src/components/views/settings/FontScalingPanel'; diff --git a/test/components/views/settings/Notifications-test.tsx b/test/components/views/settings/Notifications-test.tsx index a6f905bdd2..b1abbebed4 100644 --- a/test/components/views/settings/Notifications-test.tsx +++ b/test/components/views/settings/Notifications-test.tsx @@ -14,7 +14,6 @@ limitations under the License. import React from 'react'; import { mount } from 'enzyme'; -import '../../../skinned-sdk'; import { IPushRule, IPushRules, RuleId, IPusher } from 'matrix-js-sdk/src/matrix'; import { IThreepid, ThreepidMedium } from 'matrix-js-sdk/src/@types/threepids'; import { act } from 'react-dom/test-utils'; diff --git a/test/components/views/settings/ThemeChoicePanel-test.tsx b/test/components/views/settings/ThemeChoicePanel-test.tsx index 073a89b818..0d0a71c86c 100644 --- a/test/components/views/settings/ThemeChoicePanel-test.tsx +++ b/test/components/views/settings/ThemeChoicePanel-test.tsx @@ -17,7 +17,6 @@ limitations under the License. import React from 'react'; import { mount } from "enzyme"; -import '../../../skinned-sdk'; import * as TestUtils from "../../../test-utils"; import ThemeChoicePanel from '../../../../src/components/views/settings/ThemeChoicePanel'; diff --git a/test/components/views/spaces/QuickThemeSwitcher-test.tsx b/test/components/views/spaces/QuickThemeSwitcher-test.tsx index a297ac8ef3..c443963778 100644 --- a/test/components/views/spaces/QuickThemeSwitcher-test.tsx +++ b/test/components/views/spaces/QuickThemeSwitcher-test.tsx @@ -19,7 +19,6 @@ import { mount } from 'enzyme'; import { mocked } from 'jest-mock'; import { act } from 'react-dom/test-utils'; -import '../../../skinned-sdk'; import QuickThemeSwitcher from '../../../../src/components/views/spaces/QuickThemeSwitcher'; import { getOrderedThemes } from '../../../../src/theme'; import ThemeChoicePanel from '../../../../src/components/views/settings/ThemeChoicePanel'; diff --git a/test/components/views/spaces/SpacePanel-test.tsx b/test/components/views/spaces/SpacePanel-test.tsx index 7f2c3a95b7..e328c51188 100644 --- a/test/components/views/spaces/SpacePanel-test.tsx +++ b/test/components/views/spaces/SpacePanel-test.tsx @@ -20,7 +20,6 @@ import { mocked } from 'jest-mock'; import { MatrixClient } from 'matrix-js-sdk/src/matrix'; import { act } from "react-dom/test-utils"; -import '../../../skinned-sdk'; import SpacePanel from '../../../../src/components/views/spaces/SpacePanel'; import { MatrixClientPeg } from '../../../../src/MatrixClientPeg'; import { SpaceKey } from '../../../../src/stores/spaces'; diff --git a/test/components/views/spaces/SpaceSettingsVisibilityTab-test.tsx b/test/components/views/spaces/SpaceSettingsVisibilityTab-test.tsx index 976e030b3b..78cc602863 100644 --- a/test/components/views/spaces/SpaceSettingsVisibilityTab-test.tsx +++ b/test/components/views/spaces/SpaceSettingsVisibilityTab-test.tsx @@ -1,5 +1,3 @@ -// skinned-sdk should be the first import in most tests -import '../../../skinned-sdk'; import React from "react"; import { mocked } from 'jest-mock'; import { diff --git a/test/createRoom-test.js b/test/createRoom-test.js index fd37e0091e..84eaabdafc 100644 --- a/test/createRoom-test.js +++ b/test/createRoom-test.js @@ -1,4 +1,3 @@ -import './skinned-sdk'; // Must be first for skinning to work import { EventEmitter } from 'events'; import { waitForMember, canEncryptToAllUsers } from '../src/createRoom'; diff --git a/test/editor/caret-test.js b/test/editor/caret-test.js index 33b40e1c64..e1a66a4431 100644 --- a/test/editor/caret-test.js +++ b/test/editor/caret-test.js @@ -14,7 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. */ -import "../skinned-sdk"; // Must be first for skinning to work import { getLineAndNodePosition } from "../../src/editor/caret"; import EditorModel from "../../src/editor/model"; import { createPartCreator } from "./mock"; diff --git a/test/editor/deserialize-test.js b/test/editor/deserialize-test.js index 050254401d..7ee522caf7 100644 --- a/test/editor/deserialize-test.js +++ b/test/editor/deserialize-test.js @@ -14,7 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. */ -import '../skinned-sdk'; // Must be first for skinning to work import { parseEvent } from "../../src/editor/deserialize"; import { createPartCreator } from "./mock"; diff --git a/test/editor/model-test.js b/test/editor/model-test.js index 3d0aa5cf64..8ed4e78bbf 100644 --- a/test/editor/model-test.js +++ b/test/editor/model-test.js @@ -14,7 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. */ -import "../skinned-sdk"; // Must be first for skinning to work import EditorModel from "../../src/editor/model"; import { createPartCreator, createRenderer } from "./mock"; diff --git a/test/editor/operations-test.js b/test/editor/operations-test.js index 1db5660840..b9ab4cc4e8 100644 --- a/test/editor/operations-test.js +++ b/test/editor/operations-test.js @@ -14,7 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. */ -import "../skinned-sdk"; // Must be first for skinning to work import EditorModel from "../../src/editor/model"; import { createPartCreator, createRenderer } from "./mock"; import { diff --git a/test/editor/position-test.js b/test/editor/position-test.js index ea8658b216..813a8e9f7f 100644 --- a/test/editor/position-test.js +++ b/test/editor/position-test.js @@ -14,7 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. */ -import "../skinned-sdk"; // Must be first for skinning to work import EditorModel from "../../src/editor/model"; import { createPartCreator } from "./mock"; diff --git a/test/editor/range-test.js b/test/editor/range-test.js index 42ec6de60d..d0122146a5 100644 --- a/test/editor/range-test.js +++ b/test/editor/range-test.js @@ -14,7 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. */ -import "../skinned-sdk"; // Must be first for skinning to work import EditorModel from "../../src/editor/model"; import { createPartCreator, createRenderer } from "./mock"; diff --git a/test/editor/serialize-test.js b/test/editor/serialize-test.js index 085a8afdba..691130bd34 100644 --- a/test/editor/serialize-test.js +++ b/test/editor/serialize-test.js @@ -14,7 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. */ -import "../skinned-sdk"; // Must be first for skinning to work import EditorModel from "../../src/editor/model"; import { htmlSerializeIfNeeded } from "../../src/editor/serialize"; import { createPartCreator } from "./mock"; diff --git a/test/minimal-sdk.js b/test/minimal-sdk.js deleted file mode 100644 index fb40ebd3c5..0000000000 --- a/test/minimal-sdk.js +++ /dev/null @@ -1,29 +0,0 @@ -/* -Copyright 2022 The Matrix.org Foundation C.I.C. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -/* - * minimal-sdk.js - * - * Starts up the skin system with even less than `skinned-sdk`. - */ - -import * as sdk from "../src/index"; - -const components = {}; - -// sdk.loadSkin({ components }); - -export default sdk; diff --git a/test/skinned-sdk.js b/test/skinned-sdk.js deleted file mode 100644 index aa4fffe8e6..0000000000 --- a/test/skinned-sdk.js +++ /dev/null @@ -1,28 +0,0 @@ -/* - * skinned-sdk.js - * - * Skins the react-sdk with a few stub components which we expect the - * application to provide - */ - -/* this is a convenient place to ensure we load the compatibility libraries we expect our - * app to provide - */ - -import * as sdk from "../src/index"; -import stubComponent from "./components/stub-component"; - -const components = {}; -components['structures.LeftPanel'] = stubComponent(); -components['structures.RightPanel'] = stubComponent(); -components['structures.RoomDirectory'] = stubComponent(); -components['views.globals.GuestWarningBar'] = stubComponent(); -components['views.globals.NewVersionBar'] = stubComponent(); -components['views.elements.Spinner'] = stubComponent({ displayName: 'Spinner' }); -components['views.messages.MessageTimestamp'] = stubComponent({ displayName: 'MessageTimestamp' }); -components['views.messages.SenderProfile'] = stubComponent({ displayName: 'SenderProfile' }); -components['views.rooms.SearchBar'] = stubComponent(); - -// sdk.loadSkin({ components }); - -export default sdk; diff --git a/test/stores/RoomViewStore-test.js b/test/stores/RoomViewStore-test.js index 6c9e8d47f9..bc2bd2e936 100644 --- a/test/stores/RoomViewStore-test.js +++ b/test/stores/RoomViewStore-test.js @@ -14,7 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. */ -import '../skinned-sdk'; // Must be first for skinning to work import RoomViewStore from '../../src/stores/RoomViewStore'; import { Action } from '../../src/dispatcher/actions'; import { MatrixClientPeg as peg } from '../../src/MatrixClientPeg'; diff --git a/test/stores/SpaceStore-test.ts b/test/stores/SpaceStore-test.ts index 60faa55804..47c3f974b2 100644 --- a/test/stores/SpaceStore-test.ts +++ b/test/stores/SpaceStore-test.ts @@ -21,7 +21,6 @@ import { RoomStateEvent } from "matrix-js-sdk/src/models/room-state"; import { defer } from "matrix-js-sdk/src/utils"; import { ClientEvent, RoomEvent, MatrixEvent } from 'matrix-js-sdk/src/matrix'; -import "../skinned-sdk"; // Must be first for skinning to work import SpaceStore from "../../src/stores/spaces/SpaceStore"; import { MetaSpace, diff --git a/test/stores/VoiceChannelStore-test.ts b/test/stores/VoiceChannelStore-test.ts index cf70e7314c..46f85fbc86 100644 --- a/test/stores/VoiceChannelStore-test.ts +++ b/test/stores/VoiceChannelStore-test.ts @@ -16,7 +16,6 @@ limitations under the License. import { ClientWidgetApi, MatrixWidgetType } from "matrix-widget-api"; -import "../skinned-sdk"; import { stubClient } from "../test-utils"; import WidgetStore from "../../src/stores/WidgetStore"; import { WidgetMessagingStore } from "../../src/stores/widgets/WidgetMessagingStore"; diff --git a/test/stores/VoiceRecordingStore-test.ts b/test/stores/VoiceRecordingStore-test.ts index 1c8bb86cb3..7be07bed6f 100644 --- a/test/stores/VoiceRecordingStore-test.ts +++ b/test/stores/VoiceRecordingStore-test.ts @@ -17,7 +17,6 @@ limitations under the License. import { MatrixClient } from "matrix-js-sdk/src/matrix"; -import "../skinned-sdk"; // Must be first for skinning to work import { VoiceRecording } from '../../src/audio/VoiceRecording'; import { VoiceRecordingStore } from '../../src/stores/VoiceRecordingStore'; import { MatrixClientPeg } from "../../src/MatrixClientPeg"; diff --git a/test/stores/WidgetLayoutStore-test.ts b/test/stores/WidgetLayoutStore-test.ts index 139c31b176..eb41d1231a 100644 --- a/test/stores/WidgetLayoutStore-test.ts +++ b/test/stores/WidgetLayoutStore-test.ts @@ -14,7 +14,6 @@ See the License for the specific language governing permissions and limitations under the License. */ -import "../skinned-sdk"; // Must be first for skinning to work import { Room } from "matrix-js-sdk/src/matrix"; import WidgetStore, { IApp } from "../../src/stores/WidgetStore"; diff --git a/test/stores/notifications/RoomNotificationState-test.ts b/test/stores/notifications/RoomNotificationState-test.ts index befa1a0008..904e068909 100644 --- a/test/stores/notifications/RoomNotificationState-test.ts +++ b/test/stores/notifications/RoomNotificationState-test.ts @@ -17,7 +17,6 @@ limitations under the License. import { Room } from "matrix-js-sdk/src/models/room"; import { MatrixEventEvent, MatrixEvent } from "matrix-js-sdk/src/matrix"; -import "../../skinned-sdk"; import { stubClient } from "../../test-utils"; import { MatrixClientPeg } from "../../../src/MatrixClientPeg"; import { RoomNotificationState } from "../../../src/stores/notifications/RoomNotificationState"; diff --git a/test/stores/room-list/SpaceWatcher-test.ts b/test/stores/room-list/SpaceWatcher-test.ts index b870da6aa1..9664c9dd8c 100644 --- a/test/stores/room-list/SpaceWatcher-test.ts +++ b/test/stores/room-list/SpaceWatcher-test.ts @@ -15,7 +15,6 @@ limitations under the License. */ import { mocked } from 'jest-mock'; -import "../../skinned-sdk"; // Must be first for skinning to work import { SpaceWatcher } from "../../../src/stores/room-list/SpaceWatcher"; import type { RoomListStoreClass } from "../../../src/stores/room-list/RoomListStore"; import SettingsStore from "../../../src/settings/SettingsStore"; diff --git a/test/utils/export-test.tsx b/test/utils/export-test.tsx index f385df5c2a..1c09ecf6de 100644 --- a/test/utils/export-test.tsx +++ b/test/utils/export-test.tsx @@ -27,7 +27,6 @@ import { import { MatrixClientPeg } from "../../src/MatrixClientPeg"; import { IExportOptions, ExportType, ExportFormat } from "../../src/utils/exportUtils/exportUtils"; -import '../skinned-sdk'; import PlainTextExporter from "../../src/utils/exportUtils/PlainTextExport"; import HTMLExporter from "../../src/utils/exportUtils/HtmlExport"; import * as TestUtilsMatrix from '../test-utils';