test(electrobun): expand E2E suite — 75 new tests (120 total, 14 spec files)
New specs: search, files, comms, tasks, theme, groups, keyboard, notifications, diagnostics, splash. All under 300 lines, CSS class selectors matching actual components, display toggle aware.
This commit is contained in:
parent
e73aeb4aaf
commit
dd1d692e7b
11 changed files with 755 additions and 0 deletions
62
ui-electrobun/tests/e2e/specs/notifications.test.ts
Normal file
62
ui-electrobun/tests/e2e/specs/notifications.test.ts
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
/**
|
||||
* Notification system tests — bell, drawer, clear, toast, history.
|
||||
*/
|
||||
|
||||
describe("Notification system", () => {
|
||||
it("should show the notification bell button", async () => {
|
||||
const bell = await $(".notif-btn");
|
||||
expect(await bell.isDisplayed()).toBe(true);
|
||||
});
|
||||
|
||||
it("should open notification drawer on bell click", async () => {
|
||||
const bell = await $(".notif-btn");
|
||||
await bell.click();
|
||||
await browser.pause(400);
|
||||
|
||||
const drawer = await $(".notif-drawer");
|
||||
if (await drawer.isExisting()) {
|
||||
const display = await drawer.getCSSProperty("display");
|
||||
expect(display.value).not.toBe("none");
|
||||
}
|
||||
});
|
||||
|
||||
it("should show drawer header with title", async () => {
|
||||
const title = await $(".drawer-title");
|
||||
if (await title.isExisting()) {
|
||||
expect(await title.getText()).toBe("Notifications");
|
||||
}
|
||||
});
|
||||
|
||||
it("should show clear all button", async () => {
|
||||
const clearBtn = await $(".clear-btn");
|
||||
if (await clearBtn.isExisting()) {
|
||||
expect(await clearBtn.isDisplayed()).toBe(true);
|
||||
expect(await clearBtn.getText()).toContain("Clear");
|
||||
}
|
||||
});
|
||||
|
||||
it("should show empty state or notification items", async () => {
|
||||
const empty = await $(".notif-empty");
|
||||
const items = await $$(".notif-item");
|
||||
|
||||
// Either empty state message or notification items should be present
|
||||
const hasContent =
|
||||
(await empty.isExisting() && await empty.isDisplayed()) ||
|
||||
items.length > 0;
|
||||
expect(hasContent).toBe(true);
|
||||
});
|
||||
|
||||
it("should close drawer on backdrop click", async () => {
|
||||
const backdrop = await $(".notif-backdrop");
|
||||
if (await backdrop.isExisting()) {
|
||||
await backdrop.click();
|
||||
await browser.pause(300);
|
||||
|
||||
const drawer = await $(".notif-drawer");
|
||||
if (await drawer.isExisting()) {
|
||||
const display = await drawer.getCSSProperty("display");
|
||||
expect(display.value).toBe("none");
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue