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

Commit dedc62a

Browse files
committed
Add unit test for AppTile's live tile tracking
Signed-off-by: Robin Townsend <[email protected]>
1 parent cc84206 commit dedc62a

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

test/components/views/elements/AppTile-test.tsx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,26 @@ describe("AppTile", () => {
114114
await RightPanelStore.instance.onReady();
115115
});
116116

117+
it("tracks live tiles correctly", () => {
118+
expect(AppTile.isLive("1", "r1")).toEqual(false);
119+
120+
// Try removing the tile before it gets added
121+
AppTile.removeLiveTile("1", "r1");
122+
expect(AppTile.isLive("1", "r1")).toEqual(false);
123+
124+
AppTile.addLiveTile("1", "r1");
125+
expect(AppTile.isLive("1", "r1")).toEqual(true);
126+
127+
AppTile.addLiveTile("1", "r1");
128+
expect(AppTile.isLive("1", "r1")).toEqual(true);
129+
130+
AppTile.removeLiveTile("1", "r1");
131+
expect(AppTile.isLive("1", "r1")).toEqual(true);
132+
133+
AppTile.removeLiveTile("1", "r1");
134+
expect(AppTile.isLive("1", "r1")).toEqual(false);
135+
});
136+
117137
it("destroys non-persisted right panel widget on room change", async () => {
118138
// Set up right panel state
119139
const realGetValue = SettingsStore.getValue;

0 commit comments

Comments
 (0)