Show thread notification if thread timeline is closed (#9495)
* Show thread notification if thread timeline is closed * Simplify isViewingEventTimeline statement Co-authored-by: Michael Telatynski <7t3chguy@gmail.com> * Fix show desktop notifications * Add RoomViewStore thread id assertions * Add Notifier tests * fix lint * Remove it.only Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
d273441596
commit
306a2449e5
7 changed files with 178 additions and 21 deletions
|
@ -28,6 +28,7 @@ import { act } from "react-dom/test-utils";
|
|||
import ThreadView from "../../../src/components/structures/ThreadView";
|
||||
import MatrixClientContext from "../../../src/contexts/MatrixClientContext";
|
||||
import RoomContext from "../../../src/contexts/RoomContext";
|
||||
import { SdkContextClass } from "../../../src/contexts/SDKContext";
|
||||
import { MatrixClientPeg } from "../../../src/MatrixClientPeg";
|
||||
import DMRoomMap from "../../../src/utils/DMRoomMap";
|
||||
import ResizeNotifier from "../../../src/utils/ResizeNotifier";
|
||||
|
@ -155,4 +156,13 @@ describe("ThreadView", () => {
|
|||
ROOM_ID, rootEvent2.getId(), expectedMessageBody(rootEvent2, "yolo"),
|
||||
);
|
||||
});
|
||||
|
||||
it("sets the correct thread in the room view store", async () => {
|
||||
// expect(SdkContextClass.instance.roomViewStore.getThreadId()).toBeNull();
|
||||
const { unmount } = await getComponent();
|
||||
expect(SdkContextClass.instance.roomViewStore.getThreadId()).toBe(rootEvent.getId());
|
||||
|
||||
unmount();
|
||||
await waitFor(() => expect(SdkContextClass.instance.roomViewStore.getThreadId()).toBeNull());
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue