mirror of https://github.com/vector-im/riot-web
Step 8.1: Remove skinning setup from all tests
parent
9350c50f87
commit
a987ead7d2
|
@ -6,7 +6,7 @@ const path = require('path');
|
||||||
* Unsophisticated script to create a styled, unit-tested react component.
|
* 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
|
* -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.
|
* -withStyle / -s : optional, flag to create a style file for the component. Defaults to false.
|
||||||
*
|
*
|
||||||
* eg:
|
* eg:
|
||||||
* ```
|
* ```
|
||||||
* node srcipts/make-react-component.js -f components/toasts/NewToast -s
|
* node srcipts/make-react-component.js -f components/toasts/NewToast -s
|
||||||
|
@ -15,7 +15,7 @@ const path = require('path');
|
||||||
* - src/components/toasts/NewToast.tsx
|
* - src/components/toasts/NewToast.tsx
|
||||||
* - test/components/toasts/NewToast-test.tsx
|
* - test/components/toasts/NewToast-test.tsx
|
||||||
* - res/css/components/toasts/_NewToast.scss
|
* - res/css/components/toasts/_NewToast.scss
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const TEMPLATES = {
|
const TEMPLATES = {
|
||||||
|
@ -34,7 +34,6 @@ export default %%ComponentName%%;
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { mount } from 'enzyme';
|
import { mount } from 'enzyme';
|
||||||
|
|
||||||
import '%%SkinnedSdkPath%%';
|
|
||||||
import %%ComponentName%% from '%%RelativeComponentPath%%';
|
import %%ComponentName%% from '%%RelativeComponentPath%%';
|
||||||
|
|
||||||
describe('<%%ComponentName%% />', () => {
|
describe('<%%ComponentName%% />', () => {
|
||||||
|
@ -85,10 +84,8 @@ const makeFile = async ({
|
||||||
const relativePathToComponent = path.parse(path.relative(path.dirname(newFilePath), componentFilePath || ''));
|
const relativePathToComponent = path.parse(path.relative(path.dirname(newFilePath), componentFilePath || ''));
|
||||||
const importComponentPath = path.join(relativePathToComponent.dir, relativePathToComponent.name);
|
const importComponentPath = path.join(relativePathToComponent.dir, relativePathToComponent.name);
|
||||||
|
|
||||||
const skinnedSdkPath = path.relative(path.dirname(newFilePath), 'test/skinned-sdk')
|
|
||||||
|
|
||||||
try {
|
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)}`);
|
console.log(`Created ${path.relative(process.cwd(), newFilePath)}`);
|
||||||
return newFilePath;
|
return newFilePath;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
@ -104,7 +101,6 @@ const makeFile = async ({
|
||||||
const fillTemplate = (template, componentName, relativeComponentFilePath, skinnedSdkPath) =>
|
const fillTemplate = (template, componentName, relativeComponentFilePath, skinnedSdkPath) =>
|
||||||
template.replace(/%%ComponentName%%/g, componentName)
|
template.replace(/%%ComponentName%%/g, componentName)
|
||||||
.replace(/%%RelativeComponentPath%%/g, relativeComponentFilePath)
|
.replace(/%%RelativeComponentPath%%/g, relativeComponentFilePath)
|
||||||
.replace(/%%SkinnedSdkPath%%/g, skinnedSdkPath)
|
|
||||||
|
|
||||||
|
|
||||||
const makeReactComponent = async () => {
|
const makeReactComponent = async () => {
|
||||||
|
|
|
@ -14,8 +14,6 @@ See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import './skinned-sdk';
|
|
||||||
|
|
||||||
import { IProtocol } from 'matrix-js-sdk/src/matrix';
|
import { IProtocol } from 'matrix-js-sdk/src/matrix';
|
||||||
import { CallEvent, CallState, CallType } from 'matrix-js-sdk/src/webrtc/call';
|
import { CallEvent, CallState, CallType } from 'matrix-js-sdk/src/webrtc/call';
|
||||||
import EventEmitter from 'events';
|
import EventEmitter from 'events';
|
||||||
|
|
|
@ -16,7 +16,6 @@ limitations under the License.
|
||||||
|
|
||||||
import { MatrixEvent } from 'matrix-js-sdk/src/matrix';
|
import { MatrixEvent } from 'matrix-js-sdk/src/matrix';
|
||||||
|
|
||||||
import './skinned-sdk'; // Must be first for skinning to work
|
|
||||||
import { DecryptionFailureTracker } from '../src/DecryptionFailureTracker';
|
import { DecryptionFailureTracker } from '../src/DecryptionFailureTracker';
|
||||||
|
|
||||||
class MockDecryptionError extends Error {
|
class MockDecryptionError extends Error {
|
||||||
|
|
|
@ -19,7 +19,6 @@ import { EventEmitter } from "events";
|
||||||
import { mocked } from "jest-mock";
|
import { mocked } from "jest-mock";
|
||||||
import { Room } from "matrix-js-sdk/src/matrix";
|
import { Room } from "matrix-js-sdk/src/matrix";
|
||||||
|
|
||||||
import './skinned-sdk';
|
|
||||||
import DeviceListener from "../src/DeviceListener";
|
import DeviceListener from "../src/DeviceListener";
|
||||||
import { MatrixClientPeg } from "../src/MatrixClientPeg";
|
import { MatrixClientPeg } from "../src/MatrixClientPeg";
|
||||||
import * as SetupEncryptionToast from "../src/toasts/SetupEncryptionToast";
|
import * as SetupEncryptionToast from "../src/toasts/SetupEncryptionToast";
|
||||||
|
|
|
@ -17,7 +17,6 @@ limitations under the License.
|
||||||
import fs from "fs";
|
import fs from "fs";
|
||||||
import path from "path";
|
import path from "path";
|
||||||
|
|
||||||
import './skinned-sdk';
|
|
||||||
import { blobIsAnimated, mayBeAnimated } from "../src/utils/Image";
|
import { blobIsAnimated, mayBeAnimated } from "../src/utils/Image";
|
||||||
|
|
||||||
describe("Image", () => {
|
describe("Image", () => {
|
||||||
|
|
|
@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import './skinned-sdk';
|
|
||||||
import {
|
import {
|
||||||
getNestedReplyText,
|
getNestedReplyText,
|
||||||
getParentEventId,
|
getParentEventId,
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
import './skinned-sdk';
|
|
||||||
|
|
||||||
import { EventType, MatrixEvent } from "matrix-js-sdk/src/matrix";
|
import { EventType, MatrixEvent } from "matrix-js-sdk/src/matrix";
|
||||||
import TestRenderer from 'react-test-renderer';
|
import TestRenderer from 'react-test-renderer';
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import '../skinned-sdk'; // Must be first for skinning to work
|
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { mount, ReactWrapper } from "enzyme";
|
import { mount, ReactWrapper } from "enzyme";
|
||||||
|
|
||||||
|
|
|
@ -17,8 +17,6 @@ limitations under the License.
|
||||||
import { mocked } from 'jest-mock';
|
import { mocked } from 'jest-mock';
|
||||||
import { logger } from 'matrix-js-sdk/src/logger';
|
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 { createAudioContext, decodeOgg } from '../../src/audio/compat';
|
||||||
import { Playback, PlaybackState } from "../../src/audio/Playback";
|
import { Playback, PlaybackState } from "../../src/audio/Playback";
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import "../../skinned-sdk";
|
|
||||||
import { MatrixClient, MatrixEvent } from 'matrix-js-sdk/src/matrix';
|
import { MatrixClient, MatrixEvent } from 'matrix-js-sdk/src/matrix';
|
||||||
import { EventType } from "matrix-js-sdk/src/@types/event";
|
import { EventType } from "matrix-js-sdk/src/@types/event";
|
||||||
import { CallState } from "matrix-js-sdk/src/webrtc/call";
|
import { CallState } from "matrix-js-sdk/src/webrtc/call";
|
||||||
|
|
|
@ -19,8 +19,6 @@ import TestRenderer from "react-test-renderer";
|
||||||
import { jest } from "@jest/globals";
|
import { jest } from "@jest/globals";
|
||||||
import { Room } from "matrix-js-sdk/src/models/room";
|
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 RightPanel from "../../../src/components/structures/RightPanel";
|
||||||
import { MatrixClientPeg } from "../../../src/MatrixClientPeg";
|
import { MatrixClientPeg } from "../../../src/MatrixClientPeg";
|
||||||
import ResizeNotifier from "../../../src/utils/ResizeNotifier";
|
import ResizeNotifier from "../../../src/utils/ResizeNotifier";
|
||||||
|
|
|
@ -16,7 +16,6 @@ limitations under the License.
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { shallow, mount } from "enzyme";
|
import { shallow, mount } from "enzyme";
|
||||||
import '../../skinned-sdk';
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
ThreadFilterType,
|
ThreadFilterType,
|
||||||
|
|
|
@ -20,7 +20,6 @@ import { mocked } from 'jest-mock';
|
||||||
import { logger } from 'matrix-js-sdk/src/logger';
|
import { logger } from 'matrix-js-sdk/src/logger';
|
||||||
import { act } from 'react-dom/test-utils';
|
import { act } from 'react-dom/test-utils';
|
||||||
|
|
||||||
import '../../../skinned-sdk';
|
|
||||||
import RecordingPlayback from '../../../../src/components/views/audio_messages/RecordingPlayback';
|
import RecordingPlayback from '../../../../src/components/views/audio_messages/RecordingPlayback';
|
||||||
import { Playback } from '../../../../src/audio/Playback';
|
import { Playback } from '../../../../src/audio/Playback';
|
||||||
import RoomContext, { TimelineRenderingType } from '../../../../src/contexts/RoomContext';
|
import RoomContext, { TimelineRenderingType } from '../../../../src/contexts/RoomContext';
|
||||||
|
|
|
@ -17,7 +17,6 @@ limitations under the License.
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { mount } from "enzyme";
|
import { mount } from "enzyme";
|
||||||
|
|
||||||
import "../../../skinned-sdk";
|
|
||||||
import ContextMenu, { ChevronFace } from "../../../../src/components/structures/ContextMenu";
|
import ContextMenu, { ChevronFace } from "../../../../src/components/structures/ContextMenu";
|
||||||
import UIStore from "../../../../src/stores/UIStore";
|
import UIStore from "../../../../src/stores/UIStore";
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,6 @@ import { Room } from 'matrix-js-sdk/src/models/room';
|
||||||
import { PendingEventOrdering } from 'matrix-js-sdk/src/matrix';
|
import { PendingEventOrdering } from 'matrix-js-sdk/src/matrix';
|
||||||
import { ExtensibleEvent, MessageEvent, M_POLL_KIND_DISCLOSED, PollStartEvent } from 'matrix-events-sdk';
|
import { ExtensibleEvent, MessageEvent, M_POLL_KIND_DISCLOSED, PollStartEvent } from 'matrix-events-sdk';
|
||||||
|
|
||||||
import '../../../skinned-sdk';
|
|
||||||
import * as TestUtils from '../../../test-utils';
|
import * as TestUtils from '../../../test-utils';
|
||||||
import MessageContextMenu from '../../../../src/components/views/context_menus/MessageContextMenu';
|
import MessageContextMenu from '../../../../src/components/views/context_menus/MessageContextMenu';
|
||||||
import { MatrixClientPeg } from '../../../../src/MatrixClientPeg';
|
import { MatrixClientPeg } from '../../../../src/MatrixClientPeg';
|
||||||
|
|
|
@ -20,7 +20,6 @@ import { Room } from 'matrix-js-sdk/src/matrix';
|
||||||
import { mocked } from 'jest-mock';
|
import { mocked } from 'jest-mock';
|
||||||
import { act } from 'react-dom/test-utils';
|
import { act } from 'react-dom/test-utils';
|
||||||
|
|
||||||
import '../../../skinned-sdk';
|
|
||||||
import SpaceContextMenu from '../../../../src/components/views/context_menus/SpaceContextMenu';
|
import SpaceContextMenu from '../../../../src/components/views/context_menus/SpaceContextMenu';
|
||||||
import MatrixClientContext from '../../../../src/contexts/MatrixClientContext';
|
import MatrixClientContext from '../../../../src/contexts/MatrixClientContext';
|
||||||
import { findByTestId } from '../../../test-utils';
|
import { findByTestId } from '../../../test-utils';
|
||||||
|
|
|
@ -20,7 +20,6 @@ import { mocked } from 'jest-mock';
|
||||||
import { act } from "react-dom/test-utils";
|
import { act } from "react-dom/test-utils";
|
||||||
import { Room } from 'matrix-js-sdk/src/matrix';
|
import { Room } from 'matrix-js-sdk/src/matrix';
|
||||||
|
|
||||||
import '../../../skinned-sdk';
|
|
||||||
import ExportDialog from '../../../../src/components/views/dialogs/ExportDialog';
|
import ExportDialog from '../../../../src/components/views/dialogs/ExportDialog';
|
||||||
import { ExportType, ExportFormat } from '../../../../src/utils/exportUtils/exportUtils';
|
import { ExportType, ExportFormat } from '../../../../src/utils/exportUtils/exportUtils';
|
||||||
import { createTestClient, mkStubRoom } from '../../../test-utils';
|
import { createTestClient, mkStubRoom } from '../../../test-utils';
|
||||||
|
|
|
@ -14,8 +14,6 @@ See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import "../../../skinned-sdk";
|
|
||||||
|
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { mount } from "enzyme";
|
import { mount } from "enzyme";
|
||||||
import { act } from "react-dom/test-utils";
|
import { act } from "react-dom/test-utils";
|
||||||
|
|
|
@ -20,8 +20,6 @@ import { jest } from "@jest/globals";
|
||||||
import { Room } from "matrix-js-sdk/src/models/room";
|
import { Room } from "matrix-js-sdk/src/models/room";
|
||||||
import { MatrixWidgetType } from "matrix-widget-api";
|
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 RightPanel from "../../../../src/components/structures/RightPanel";
|
||||||
import { MatrixClientPeg } from "../../../../src/MatrixClientPeg";
|
import { MatrixClientPeg } from "../../../../src/MatrixClientPeg";
|
||||||
import ResizeNotifier from "../../../../src/utils/ResizeNotifier";
|
import ResizeNotifier from "../../../../src/utils/ResizeNotifier";
|
||||||
|
|
|
@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import '../../../skinned-sdk';
|
|
||||||
import { Direction, mouseWithinRegion } from "../../../../src/components/views/elements/InteractiveTooltip";
|
import { Direction, mouseWithinRegion } from "../../../../src/components/views/elements/InteractiveTooltip";
|
||||||
|
|
||||||
describe("InteractiveTooltip", () => {
|
describe("InteractiveTooltip", () => {
|
||||||
|
|
|
@ -14,8 +14,6 @@ See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// skinned-sdk should be the first import in most tests
|
|
||||||
import '../../../skinned-sdk';
|
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { mount, ReactWrapper } from "enzyme";
|
import { mount, ReactWrapper } from "enzyme";
|
||||||
import { Room } from "matrix-js-sdk/src/models/room";
|
import { Room } from "matrix-js-sdk/src/models/room";
|
||||||
|
|
|
@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import "../../../skinned-sdk";
|
|
||||||
import * as testUtils from '../../../test-utils';
|
import * as testUtils from '../../../test-utils';
|
||||||
import { getParentEventId } from "../../../../src/utils/Reply";
|
import { getParentEventId } from "../../../../src/utils/Reply";
|
||||||
|
|
||||||
|
|
|
@ -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
|
See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
import "../../../skinned-sdk";
|
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { mount } from 'enzyme';
|
import { mount } from 'enzyme';
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
// skinned-sdk should be the first import in most tests
|
|
||||||
import '../../../skinned-sdk';
|
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import {
|
import {
|
||||||
renderIntoDocument,
|
renderIntoDocument,
|
||||||
|
|
|
@ -23,7 +23,6 @@ import { MatrixClient } from 'matrix-js-sdk/src/client';
|
||||||
import { mocked } from 'jest-mock';
|
import { mocked } from 'jest-mock';
|
||||||
import { logger } from 'matrix-js-sdk/src/logger';
|
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 LocationPicker from "../../../../src/components/views/location/LocationPicker";
|
||||||
import { LocationShareType } from "../../../../src/components/views/location/shareLocation";
|
import { LocationShareType } from "../../../../src/components/views/location/shareLocation";
|
||||||
import MatrixClientContext from '../../../../src/contexts/MatrixClientContext';
|
import MatrixClientContext from '../../../../src/contexts/MatrixClientContext';
|
||||||
|
|
|
@ -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 { M_ASSET, LocationAssetType } from 'matrix-js-sdk/src/@types/location';
|
||||||
import { logger } from 'matrix-js-sdk/src/logger';
|
import { logger } from 'matrix-js-sdk/src/logger';
|
||||||
|
|
||||||
import '../../../skinned-sdk';
|
|
||||||
import LocationShareMenu from '../../../../src/components/views/location/LocationShareMenu';
|
import LocationShareMenu from '../../../../src/components/views/location/LocationShareMenu';
|
||||||
import MatrixClientContext from '../../../../src/contexts/MatrixClientContext';
|
import MatrixClientContext from '../../../../src/contexts/MatrixClientContext';
|
||||||
import { ChevronFace } from '../../../../src/components/structures/ContextMenu';
|
import { ChevronFace } from '../../../../src/components/structures/ContextMenu';
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
import '../../../skinned-sdk'; // Must be first for skinning to work
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import TestRenderer from 'react-test-renderer';
|
import TestRenderer from 'react-test-renderer';
|
||||||
import { EventEmitter } from 'events';
|
import { EventEmitter } from 'events';
|
||||||
|
|
|
@ -21,7 +21,6 @@ import { act } from "react-dom/test-utils";
|
||||||
import { Room, User, MatrixClient } from 'matrix-js-sdk/src/matrix';
|
import { Room, User, MatrixClient } from 'matrix-js-sdk/src/matrix';
|
||||||
import { Phase, VerificationRequest } from 'matrix-js-sdk/src/crypto/verification/request/VerificationRequest';
|
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 UserInfo from '../../../../src/components/views/right_panel/UserInfo';
|
||||||
import { RightPanelPhases } from '../../../../src/stores/right-panel/RightPanelStorePhases';
|
import { RightPanelPhases } from '../../../../src/stores/right-panel/RightPanelStorePhases';
|
||||||
import { MatrixClientPeg } from '../../../../src/MatrixClientPeg';
|
import { MatrixClientPeg } from '../../../../src/MatrixClientPeg';
|
||||||
|
|
|
@ -14,8 +14,6 @@ See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import "../../../skinned-sdk";
|
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import ReactTestUtils from 'react-dom/test-utils';
|
import ReactTestUtils from 'react-dom/test-utils';
|
||||||
import ReactDOM from 'react-dom';
|
import ReactDOM from 'react-dom';
|
||||||
|
|
|
@ -2,7 +2,6 @@ import React from 'react';
|
||||||
import { mount, ReactWrapper } from 'enzyme';
|
import { mount, ReactWrapper } from 'enzyme';
|
||||||
import { Room, PendingEventOrdering, MatrixEvent, MatrixClient } from 'matrix-js-sdk/src/matrix';
|
import { Room, PendingEventOrdering, MatrixEvent, MatrixClient } from 'matrix-js-sdk/src/matrix';
|
||||||
|
|
||||||
import "../../../skinned-sdk";
|
|
||||||
import * as TestUtils from '../../../test-utils';
|
import * as TestUtils from '../../../test-utils';
|
||||||
import { MatrixClientPeg } from '../../../../src/MatrixClientPeg';
|
import { MatrixClientPeg } from '../../../../src/MatrixClientPeg';
|
||||||
import DMRoomMap from '../../../../src/utils/DMRoomMap';
|
import DMRoomMap from '../../../../src/utils/DMRoomMap';
|
||||||
|
|
|
@ -23,7 +23,6 @@ import {
|
||||||
} from 'react-dom/test-utils';
|
} from 'react-dom/test-utils';
|
||||||
import { Room, RoomMember, MatrixError, IContent } from 'matrix-js-sdk/src/matrix';
|
import { Room, RoomMember, MatrixError, IContent } from 'matrix-js-sdk/src/matrix';
|
||||||
|
|
||||||
import "../../../skinned-sdk";
|
|
||||||
import { stubClient } from '../../../test-utils';
|
import { stubClient } from '../../../test-utils';
|
||||||
import { MatrixClientPeg } from '../../../../src/MatrixClientPeg';
|
import { MatrixClientPeg } from '../../../../src/MatrixClientPeg';
|
||||||
import DMRoomMap from '../../../../src/utils/DMRoomMap';
|
import DMRoomMap from '../../../../src/utils/DMRoomMap';
|
||||||
|
|
|
@ -20,7 +20,6 @@ import { sleep } from "matrix-js-sdk/src/utils";
|
||||||
import { MatrixClient } from "matrix-js-sdk/src/matrix";
|
import { MatrixClient } from "matrix-js-sdk/src/matrix";
|
||||||
import { mount } from 'enzyme';
|
import { mount } from 'enzyme';
|
||||||
|
|
||||||
import '../../../skinned-sdk'; // Must be first for skinning to work
|
|
||||||
import SendMessageComposer, {
|
import SendMessageComposer, {
|
||||||
createMessageContent,
|
createMessageContent,
|
||||||
isQuickReaction,
|
isQuickReaction,
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
import '../../../skinned-sdk';
|
|
||||||
|
|
||||||
import React, { ReactElement } from 'react';
|
import React, { ReactElement } from 'react';
|
||||||
import ReactDOM from 'react-dom';
|
import ReactDOM from 'react-dom';
|
||||||
import { MatrixClient } from 'matrix-js-sdk/src/matrix';
|
import { MatrixClient } from 'matrix-js-sdk/src/matrix';
|
||||||
|
|
|
@ -17,7 +17,6 @@ limitations under the License.
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { mount } from "enzyme";
|
import { mount } from "enzyme";
|
||||||
|
|
||||||
import '../../../skinned-sdk';
|
|
||||||
import * as TestUtils from "../../../test-utils";
|
import * as TestUtils from "../../../test-utils";
|
||||||
import FontScalingPanel from '../../../../src/components/views/settings/FontScalingPanel';
|
import FontScalingPanel from '../../../../src/components/views/settings/FontScalingPanel';
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,6 @@ limitations under the License.
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { mount } from 'enzyme';
|
import { mount } from 'enzyme';
|
||||||
import '../../../skinned-sdk';
|
|
||||||
import { IPushRule, IPushRules, RuleId, IPusher } from 'matrix-js-sdk/src/matrix';
|
import { IPushRule, IPushRules, RuleId, IPusher } from 'matrix-js-sdk/src/matrix';
|
||||||
import { IThreepid, ThreepidMedium } from 'matrix-js-sdk/src/@types/threepids';
|
import { IThreepid, ThreepidMedium } from 'matrix-js-sdk/src/@types/threepids';
|
||||||
import { act } from 'react-dom/test-utils';
|
import { act } from 'react-dom/test-utils';
|
||||||
|
|
|
@ -17,7 +17,6 @@ limitations under the License.
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { mount } from "enzyme";
|
import { mount } from "enzyme";
|
||||||
|
|
||||||
import '../../../skinned-sdk';
|
|
||||||
import * as TestUtils from "../../../test-utils";
|
import * as TestUtils from "../../../test-utils";
|
||||||
import ThemeChoicePanel from '../../../../src/components/views/settings/ThemeChoicePanel';
|
import ThemeChoicePanel from '../../../../src/components/views/settings/ThemeChoicePanel';
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,6 @@ import { mount } from 'enzyme';
|
||||||
import { mocked } from 'jest-mock';
|
import { mocked } from 'jest-mock';
|
||||||
import { act } from 'react-dom/test-utils';
|
import { act } from 'react-dom/test-utils';
|
||||||
|
|
||||||
import '../../../skinned-sdk';
|
|
||||||
import QuickThemeSwitcher from '../../../../src/components/views/spaces/QuickThemeSwitcher';
|
import QuickThemeSwitcher from '../../../../src/components/views/spaces/QuickThemeSwitcher';
|
||||||
import { getOrderedThemes } from '../../../../src/theme';
|
import { getOrderedThemes } from '../../../../src/theme';
|
||||||
import ThemeChoicePanel from '../../../../src/components/views/settings/ThemeChoicePanel';
|
import ThemeChoicePanel from '../../../../src/components/views/settings/ThemeChoicePanel';
|
||||||
|
|
|
@ -20,7 +20,6 @@ import { mocked } from 'jest-mock';
|
||||||
import { MatrixClient } from 'matrix-js-sdk/src/matrix';
|
import { MatrixClient } from 'matrix-js-sdk/src/matrix';
|
||||||
import { act } from "react-dom/test-utils";
|
import { act } from "react-dom/test-utils";
|
||||||
|
|
||||||
import '../../../skinned-sdk';
|
|
||||||
import SpacePanel from '../../../../src/components/views/spaces/SpacePanel';
|
import SpacePanel from '../../../../src/components/views/spaces/SpacePanel';
|
||||||
import { MatrixClientPeg } from '../../../../src/MatrixClientPeg';
|
import { MatrixClientPeg } from '../../../../src/MatrixClientPeg';
|
||||||
import { SpaceKey } from '../../../../src/stores/spaces';
|
import { SpaceKey } from '../../../../src/stores/spaces';
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
// skinned-sdk should be the first import in most tests
|
|
||||||
import '../../../skinned-sdk';
|
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { mocked } from 'jest-mock';
|
import { mocked } from 'jest-mock';
|
||||||
import {
|
import {
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
import './skinned-sdk'; // Must be first for skinning to work
|
|
||||||
import { EventEmitter } from 'events';
|
import { EventEmitter } from 'events';
|
||||||
|
|
||||||
import { waitForMember, canEncryptToAllUsers } from '../src/createRoom';
|
import { waitForMember, canEncryptToAllUsers } from '../src/createRoom';
|
||||||
|
|
|
@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import "../skinned-sdk"; // Must be first for skinning to work
|
|
||||||
import { getLineAndNodePosition } from "../../src/editor/caret";
|
import { getLineAndNodePosition } from "../../src/editor/caret";
|
||||||
import EditorModel from "../../src/editor/model";
|
import EditorModel from "../../src/editor/model";
|
||||||
import { createPartCreator } from "./mock";
|
import { createPartCreator } from "./mock";
|
||||||
|
|
|
@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import '../skinned-sdk'; // Must be first for skinning to work
|
|
||||||
import { parseEvent } from "../../src/editor/deserialize";
|
import { parseEvent } from "../../src/editor/deserialize";
|
||||||
import { createPartCreator } from "./mock";
|
import { createPartCreator } from "./mock";
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import "../skinned-sdk"; // Must be first for skinning to work
|
|
||||||
import EditorModel from "../../src/editor/model";
|
import EditorModel from "../../src/editor/model";
|
||||||
import { createPartCreator, createRenderer } from "./mock";
|
import { createPartCreator, createRenderer } from "./mock";
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import "../skinned-sdk"; // Must be first for skinning to work
|
|
||||||
import EditorModel from "../../src/editor/model";
|
import EditorModel from "../../src/editor/model";
|
||||||
import { createPartCreator, createRenderer } from "./mock";
|
import { createPartCreator, createRenderer } from "./mock";
|
||||||
import {
|
import {
|
||||||
|
|
|
@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import "../skinned-sdk"; // Must be first for skinning to work
|
|
||||||
import EditorModel from "../../src/editor/model";
|
import EditorModel from "../../src/editor/model";
|
||||||
import { createPartCreator } from "./mock";
|
import { createPartCreator } from "./mock";
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import "../skinned-sdk"; // Must be first for skinning to work
|
|
||||||
import EditorModel from "../../src/editor/model";
|
import EditorModel from "../../src/editor/model";
|
||||||
import { createPartCreator, createRenderer } from "./mock";
|
import { createPartCreator, createRenderer } from "./mock";
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import "../skinned-sdk"; // Must be first for skinning to work
|
|
||||||
import EditorModel from "../../src/editor/model";
|
import EditorModel from "../../src/editor/model";
|
||||||
import { htmlSerializeIfNeeded } from "../../src/editor/serialize";
|
import { htmlSerializeIfNeeded } from "../../src/editor/serialize";
|
||||||
import { createPartCreator } from "./mock";
|
import { createPartCreator } from "./mock";
|
||||||
|
|
|
@ -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;
|
|
|
@ -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;
|
|
|
@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import '../skinned-sdk'; // Must be first for skinning to work
|
|
||||||
import RoomViewStore from '../../src/stores/RoomViewStore';
|
import RoomViewStore from '../../src/stores/RoomViewStore';
|
||||||
import { Action } from '../../src/dispatcher/actions';
|
import { Action } from '../../src/dispatcher/actions';
|
||||||
import { MatrixClientPeg as peg } from '../../src/MatrixClientPeg';
|
import { MatrixClientPeg as peg } from '../../src/MatrixClientPeg';
|
||||||
|
|
|
@ -21,7 +21,6 @@ import { RoomStateEvent } from "matrix-js-sdk/src/models/room-state";
|
||||||
import { defer } from "matrix-js-sdk/src/utils";
|
import { defer } from "matrix-js-sdk/src/utils";
|
||||||
import { ClientEvent, RoomEvent, MatrixEvent } from 'matrix-js-sdk/src/matrix';
|
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 SpaceStore from "../../src/stores/spaces/SpaceStore";
|
||||||
import {
|
import {
|
||||||
MetaSpace,
|
MetaSpace,
|
||||||
|
|
|
@ -16,7 +16,6 @@ limitations under the License.
|
||||||
|
|
||||||
import { ClientWidgetApi, MatrixWidgetType } from "matrix-widget-api";
|
import { ClientWidgetApi, MatrixWidgetType } from "matrix-widget-api";
|
||||||
|
|
||||||
import "../skinned-sdk";
|
|
||||||
import { stubClient } from "../test-utils";
|
import { stubClient } from "../test-utils";
|
||||||
import WidgetStore from "../../src/stores/WidgetStore";
|
import WidgetStore from "../../src/stores/WidgetStore";
|
||||||
import { WidgetMessagingStore } from "../../src/stores/widgets/WidgetMessagingStore";
|
import { WidgetMessagingStore } from "../../src/stores/widgets/WidgetMessagingStore";
|
||||||
|
|
|
@ -17,7 +17,6 @@ limitations under the License.
|
||||||
|
|
||||||
import { MatrixClient } from "matrix-js-sdk/src/matrix";
|
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 { VoiceRecording } from '../../src/audio/VoiceRecording';
|
||||||
import { VoiceRecordingStore } from '../../src/stores/VoiceRecordingStore';
|
import { VoiceRecordingStore } from '../../src/stores/VoiceRecordingStore';
|
||||||
import { MatrixClientPeg } from "../../src/MatrixClientPeg";
|
import { MatrixClientPeg } from "../../src/MatrixClientPeg";
|
||||||
|
|
|
@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import "../skinned-sdk"; // Must be first for skinning to work
|
|
||||||
import { Room } from "matrix-js-sdk/src/matrix";
|
import { Room } from "matrix-js-sdk/src/matrix";
|
||||||
|
|
||||||
import WidgetStore, { IApp } from "../../src/stores/WidgetStore";
|
import WidgetStore, { IApp } from "../../src/stores/WidgetStore";
|
||||||
|
|
|
@ -17,7 +17,6 @@ limitations under the License.
|
||||||
import { Room } from "matrix-js-sdk/src/models/room";
|
import { Room } from "matrix-js-sdk/src/models/room";
|
||||||
import { MatrixEventEvent, MatrixEvent } from "matrix-js-sdk/src/matrix";
|
import { MatrixEventEvent, MatrixEvent } from "matrix-js-sdk/src/matrix";
|
||||||
|
|
||||||
import "../../skinned-sdk";
|
|
||||||
import { stubClient } from "../../test-utils";
|
import { stubClient } from "../../test-utils";
|
||||||
import { MatrixClientPeg } from "../../../src/MatrixClientPeg";
|
import { MatrixClientPeg } from "../../../src/MatrixClientPeg";
|
||||||
import { RoomNotificationState } from "../../../src/stores/notifications/RoomNotificationState";
|
import { RoomNotificationState } from "../../../src/stores/notifications/RoomNotificationState";
|
||||||
|
|
|
@ -15,7 +15,6 @@ limitations under the License.
|
||||||
*/
|
*/
|
||||||
import { mocked } from 'jest-mock';
|
import { mocked } from 'jest-mock';
|
||||||
|
|
||||||
import "../../skinned-sdk"; // Must be first for skinning to work
|
|
||||||
import { SpaceWatcher } from "../../../src/stores/room-list/SpaceWatcher";
|
import { SpaceWatcher } from "../../../src/stores/room-list/SpaceWatcher";
|
||||||
import type { RoomListStoreClass } from "../../../src/stores/room-list/RoomListStore";
|
import type { RoomListStoreClass } from "../../../src/stores/room-list/RoomListStore";
|
||||||
import SettingsStore from "../../../src/settings/SettingsStore";
|
import SettingsStore from "../../../src/settings/SettingsStore";
|
||||||
|
|
|
@ -27,7 +27,6 @@ import {
|
||||||
|
|
||||||
import { MatrixClientPeg } from "../../src/MatrixClientPeg";
|
import { MatrixClientPeg } from "../../src/MatrixClientPeg";
|
||||||
import { IExportOptions, ExportType, ExportFormat } from "../../src/utils/exportUtils/exportUtils";
|
import { IExportOptions, ExportType, ExportFormat } from "../../src/utils/exportUtils/exportUtils";
|
||||||
import '../skinned-sdk';
|
|
||||||
import PlainTextExporter from "../../src/utils/exportUtils/PlainTextExport";
|
import PlainTextExporter from "../../src/utils/exportUtils/PlainTextExport";
|
||||||
import HTMLExporter from "../../src/utils/exportUtils/HtmlExport";
|
import HTMLExporter from "../../src/utils/exportUtils/HtmlExport";
|
||||||
import * as TestUtilsMatrix from '../test-utils';
|
import * as TestUtilsMatrix from '../test-utils';
|
||||||
|
|
Loading…
Reference in New Issue