Skip to content

Commit

Permalink
fix(subtree): bugreporting tests hardcoded deps path
Browse files Browse the repository at this point in the history
  • Loading branch information
marc.sirisak committed Apr 13, 2024
1 parent d2807b7 commit d62c8aa
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -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("<BugReportDialog>", () => {
const bugReportUrl = "/bug/report/url";
Expand All @@ -23,7 +23,7 @@ describe("<BugReportDialog>", () => {
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);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down
7 changes: 2 additions & 5 deletions test/unit-tests/tchap/rageshake/submit-rageshake-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit d62c8aa

Please sign in to comment.