Skip to content

Commit

Permalink
Iterate
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Telatynski <[email protected]>
  • Loading branch information
t3chguy committed Oct 17, 2024
1 parent 9148e35 commit 457e7d5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 13 deletions.
13 changes: 4 additions & 9 deletions test/unit-tests/components/structures/MatrixChat-test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ import * as Lifecycle from "../../../../src/Lifecycle";
import { SSO_HOMESERVER_URL_KEY, SSO_ID_SERVER_URL_KEY } from "../../../../src/BasePlatform";
import SettingsStore from "../../../../src/settings/SettingsStore";
import { SettingLevel } from "../../../../src/settings/SettingLevel";
import { MatrixClientPeg, MatrixClientPeg as peg } from "../../../../src/MatrixClientPeg";
import { MatrixClientPeg } from "../../../../src/MatrixClientPeg";
import DMRoomMap from "../../../../src/utils/DMRoomMap";
import { ReleaseAnnouncementStore } from "../../../../src/stores/ReleaseAnnouncementStore";
import { DRAFT_LAST_CLEANUP_KEY } from "../../../../src/DraftCleaner";
Expand Down Expand Up @@ -932,17 +932,13 @@ describe("<MatrixChat />", () => {
// but as the exception was swallowed, the test was passing (see in `initClientCrypto`).
// There are several uses of the peg in the app, so during all these tests you might end-up
// with a real client instead of the mocked one. Not sure how reliable all these tests are.
const originalReplace = peg.replaceUsingCreds;
peg.replaceUsingCreds = jest.fn().mockResolvedValue(mockClient);
// @ts-ignore - need to mock this for the test
peg.matrixClient = mockClient;
jest.spyOn(MatrixClientPeg, "replaceUsingCreds");
jest.spyOn(MatrixClientPeg, "get").mockReturnValue(mockClient);

const result = getComponent();

await result.findByText("You're signed out");
expect(result.container).toMatchSnapshot();

peg.replaceUsingCreds = originalReplace;
});
});

Expand Down Expand Up @@ -1489,8 +1485,6 @@ describe("<MatrixChat />", () => {
action: "start_mobile_registration",
});

await flushPromises();

return renderResult;
};

Expand All @@ -1511,6 +1505,7 @@ describe("<MatrixChat />", () => {
enabledMobileRegistration();

await getComponentAndWaitForReady();
await flushPromises();

expect(screen.getByTestId("mobile-register")).toBeInTheDocument();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,6 @@ exports[`<RestoreKeyBackupDialog /> should render 1`] = `
</div>
</div>
<div
aria-describedby=":r2:"
aria-label="Close dialog"
class="mx_AccessibleButton mx_Dialog_cancelButton"
role="button"
Expand Down
3 changes: 0 additions & 3 deletions test/unit-tests/components/views/rooms/MemberList-test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -375,9 +375,6 @@ describe("MemberList", () => {
roomId={room.roomId}
/>
</SDKContext.Provider>,
{
// legacyRoot: true,
},
);
};

Expand Down

0 comments on commit 457e7d5

Please sign in to comment.