Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Fix ThreadView tests not using thread flag #9547

Merged
merged 4 commits into from
Nov 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions test/Notifier-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ describe("Notifier", () => {
decryptEventIfNeeded: jest.fn(),
getRoom: jest.fn(),
getPushActionsForEvent: jest.fn(),
supportsExperimentalThreads: jest.fn().mockReturnValue(false),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Threads don't need to be on for these tests but supportsExperimentalThreads() needs to be defined

});

mockClient.pushRules = {
Expand Down
1 change: 1 addition & 0 deletions test/components/structures/ThreadView-test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ describe("ThreadView", () => {
stubClient();
mockPlatformPeg();
mockClient = mocked(MatrixClientPeg.get());
jest.spyOn(mockClient, "supportsExperimentalThreads").mockReturnValue(true);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the changes in matrix-org/matrix-js-sdk#2856, the reason the tests failed before without this was because room.eventShouldLiveIn(...) would return threadId: undefined when supportsExperimentalThreads was turned off and we couldn't add the event to the timeline as expected.


room = new Room(ROOM_ID, mockClient, mockClient.getUserId() ?? "", {
pendingEventOrdering: PendingEventOrdering.Detached,
Expand Down