Skip to content

Commit

Permalink
simplifying text assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
eriklharper committed Jan 4, 2025
1 parent ae7c196 commit 92af4c4
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1308,7 +1308,7 @@ describe("calcite-time-picker", () => {
await page.keyboard.press("ArrowUp");
await page.waitForChanges();

expect(hour.textContent).toBe(i > 12 ? formatTimePart(i - 12) : formatTimePart(i));
expect(hour).toEqualText(i > 12 ? formatTimePart(i - 12) : formatTimePart(i));
}

await page.keyboard.press("Delete");
Expand All @@ -1319,7 +1319,7 @@ describe("calcite-time-picker", () => {
await page.keyboard.press("ArrowDown");
await page.waitForChanges();

expect(hour.textContent).toBe(i > 12 ? formatTimePart(i - 12) : formatTimePart(i));
expect(hour).toEqualText(i > 12 ? formatTimePart(i - 12) : formatTimePart(i));
}
});
});
Expand Down Expand Up @@ -1390,19 +1390,19 @@ describe("calcite-time-picker", () => {
await page.keyboard.press("ArrowUp");
await page.waitForChanges();

expect(hour.textContent).toBe(formatTimePart(i));
expect(hour).toEqualText(formatTimePart(i));
}

await page.keyboard.press("ArrowUp");
await page.waitForChanges();

expect(hour.textContent).toBe("00");
expect(hour).toEqualText("00");

for (let i = 23; i > 0; i--) {
await page.keyboard.press("ArrowDown");
await page.waitForChanges();

expect(hour.textContent).toBe(formatTimePart(i));
expect(hour).toEqualText(formatTimePart(i));
}
});
});
Expand Down

0 comments on commit 92af4c4

Please sign in to comment.