From d62c8aac1222c275bbf78d0a299383cf62b49682 Mon Sep 17 00:00:00 2001 From: "marc.sirisak" Date: Sat, 13 Apr 2024 10:21:16 +0000 Subject: [PATCH] fix(subtree): bugreporting tests hardcoded deps path --- .../views/dialogs/BugReportDialog-test.tsx | 8 ++++---- .../views/messages/LegacyCallEvent-test.tsx | 12 ++++++------ .../tchap/rageshake/submit-rageshake-test.ts | 7 ++----- 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/test/unit-tests/tchap/components/views/dialogs/BugReportDialog-test.tsx b/test/unit-tests/tchap/components/views/dialogs/BugReportDialog-test.tsx index b223c12d23..f2fb9d6aff 100644 --- a/test/unit-tests/tchap/components/views/dialogs/BugReportDialog-test.tsx +++ b/test/unit-tests/tchap/components/views/dialogs/BugReportDialog-test.tsx @@ -1,9 +1,9 @@ import * as React from "react"; import { RenderResult, fireEvent, render } from "@testing-library/react"; -import BugReportDialog from "~tchap-web/yarn-linked-dependencies/matrix-react-sdk/src/components/views/dialogs/BugReportDialog"; -import { flushPromises } from "~tchap-web/yarn-linked-dependencies/matrix-react-sdk/test/test-utils"; -import SdkConfig from "~tchap-web/yarn-linked-dependencies/matrix-react-sdk/src/SdkConfig"; +import BugReportDialog from "~linked-dep/matrix-react-sdk/src/components/views/dialogs/BugReportDialog"; +import { flushPromises } from "~linked-dep/matrix-react-sdk/test/test-utils"; +import SdkConfig from "~linked-dep/matrix-react-sdk/src/SdkConfig"; describe("", () => { const bugReportUrl = "/bug/report/url"; @@ -23,7 +23,7 @@ describe("", () => { beforeEach(() => { // Mocking trick to mock a default export : use requireActual. const actual = jest.requireActual( - "~tchap-web/yarn-linked-dependencies/matrix-react-sdk/src/rageshake/submit-rageshake", + "~linked-dep/matrix-react-sdk/src/rageshake/submit-rageshake", ); sendBugReportSpy = jest.spyOn(actual, "default").mockResolvedValue(bugReportUrl); }); diff --git a/test/unit-tests/tchap/components/views/messages/LegacyCallEvent-test.tsx b/test/unit-tests/tchap/components/views/messages/LegacyCallEvent-test.tsx index 0e26acf9b4..e354680001 100644 --- a/test/unit-tests/tchap/components/views/messages/LegacyCallEvent-test.tsx +++ b/test/unit-tests/tchap/components/views/messages/LegacyCallEvent-test.tsx @@ -2,12 +2,12 @@ import * as React from "react"; import { render, screen } from "@testing-library/react"; import { mocked } from "jest-mock"; -import { MatrixEvent } from "~tchap-web/yarn-linked-dependencies/matrix-js-sdk/src/matrix"; -import LegacyCallEvent from "~tchap-web/yarn-linked-dependencies/matrix-react-sdk/src/components/views/messages/LegacyCallEvent"; -import LegacyCallEventGrouper from "~tchap-web/yarn-linked-dependencies/matrix-react-sdk/src/components/structures/LegacyCallEventGrouper"; -import { CallErrorCode, CallState } from "~tchap-web/yarn-linked-dependencies/matrix-js-sdk/src/webrtc/call"; -import BugReportDialog from "~tchap-web/yarn-linked-dependencies/matrix-react-sdk/src/components/views/dialogs/BugReportDialog"; -import Modal from "~tchap-web/yarn-linked-dependencies/matrix-react-sdk/src/Modal"; +import { MatrixEvent } from "~tchap-web-dep/matrix-js-sdk/src/matrix"; +import LegacyCallEvent from "~linked-dep/matrix-react-sdk/src/components/views/messages/LegacyCallEvent"; +import LegacyCallEventGrouper from "~linked-dep/matrix-react-sdk/src/components/structures/LegacyCallEventGrouper"; +import { CallErrorCode, CallState } from "~tchap-web-dep/matrix-js-sdk/src/webrtc/call"; +import BugReportDialog from "~linked-dep/matrix-react-sdk/src/components/views/dialogs/BugReportDialog"; +import Modal from "~linked-dep/matrix-react-sdk/src/Modal"; const THEIR_USER_ID = "@them:here"; diff --git a/test/unit-tests/tchap/rageshake/submit-rageshake-test.ts b/test/unit-tests/tchap/rageshake/submit-rageshake-test.ts index 7b10bd49ba..a83c49c383 100644 --- a/test/unit-tests/tchap/rageshake/submit-rageshake-test.ts +++ b/test/unit-tests/tchap/rageshake/submit-rageshake-test.ts @@ -10,11 +10,8 @@ import { } from "matrix-js-sdk/src/matrix"; import fetchMock from "fetch-mock-jest"; -import { - getMockClientWithEventEmitter, - mockClientMethodsCrypto, -} from "~tchap-web-dep/matrix-react-sdk/test/test-utils"; -import { collectBugReport } from "~tchap-web-dep/matrix-react-sdk/src/rageshake/submit-rageshake"; +import { getMockClientWithEventEmitter, mockClientMethodsCrypto } from "~linked-dep/matrix-react-sdk/test/test-utils"; +import { collectBugReport } from "~linked-dep/matrix-react-sdk/src/rageshake/submit-rageshake"; /** * Based on react-sdk's test, removed unused things. Maybe this test has more mocks than strictly necessary.