Skip to content

Commit 3b2735f

Browse files
committed
test: check dreaming tab labels
1 parent 4e3b952 commit 3b2735f

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

ui/src/ui/views/dreaming.test.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,9 @@ describe("dreaming view", () => {
225225
);
226226
expect(phases).toEqual(["Light", "Deep", "Rem"]);
227227
expect(container.querySelectorAll(".dreams__phase").length).toBe(3);
228-
expect(container.querySelector(".dreams__phase--off")?.textContent).toContain("off");
228+
expect(container.querySelector(".dreams__phase--off .dreams__phase-next")?.textContent).toBe(
229+
"off",
230+
);
229231

230232
const buttons = [...container.querySelectorAll("button")].map((node) =>
231233
node.textContent?.trim(),
@@ -241,10 +243,7 @@ describe("dreaming view", () => {
241243
const detail = container.querySelector(".dreams__status-detail span");
242244
expect(detail?.textContent).toContain("4:00 AM");
243245
const tabs = container.querySelectorAll(".dreams__tab");
244-
expect(tabs.length).toBe(3);
245-
expect(tabs[0]?.textContent).toContain("Scene");
246-
expect(tabs[1]?.textContent).toContain("Diary");
247-
expect(tabs[2]?.textContent).toContain("Advanced");
246+
expect([...tabs].map((tab) => tab.textContent?.trim())).toEqual(["Scene", "Diary", "Advanced"]);
248247
});
249248

250249
it("renders idle and unavailable scene states", () => {

0 commit comments

Comments
 (0)