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
65
ui-electrobun/tests/e2e/specs/keyboard.test.ts
Normal file
65
ui-electrobun/tests/e2e/specs/keyboard.test.ts
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
/**
|
||||
* Keyboard / command palette tests — open, commands, filtering, close.
|
||||
*/
|
||||
|
||||
describe("Command palette", () => {
|
||||
it("should open via Ctrl+K", async () => {
|
||||
await browser.keys(["Control", "k"]);
|
||||
await browser.pause(400);
|
||||
|
||||
const backdrop = await $(".palette-backdrop");
|
||||
if (await backdrop.isExisting()) {
|
||||
const display = await backdrop.getCSSProperty("display");
|
||||
expect(display.value).not.toBe("none");
|
||||
}
|
||||
});
|
||||
|
||||
it("should show the palette panel with input", async () => {
|
||||
const panel = await $(".palette-panel");
|
||||
if (await panel.isExisting()) {
|
||||
expect(await panel.isDisplayed()).toBe(true);
|
||||
}
|
||||
|
||||
const input = await $(".palette-input");
|
||||
if (await input.isExisting()) {
|
||||
expect(await input.isDisplayed()).toBe(true);
|
||||
}
|
||||
});
|
||||
|
||||
it("should list 18 commands", async () => {
|
||||
const items = await $$(".palette-item");
|
||||
expect(items.length).toBe(18);
|
||||
});
|
||||
|
||||
it("should show command labels and shortcuts", async () => {
|
||||
const labels = await $$(".cmd-label");
|
||||
expect(labels.length).toBeGreaterThan(0);
|
||||
|
||||
const shortcuts = await $$(".cmd-shortcut");
|
||||
expect(shortcuts.length).toBeGreaterThan(0);
|
||||
});
|
||||
|
||||
it("should filter commands on text input", async () => {
|
||||
const input = await $(".palette-input");
|
||||
if (!(await input.isExisting())) return;
|
||||
|
||||
await input.setValue("terminal");
|
||||
await browser.pause(200);
|
||||
|
||||
const items = await $$(".palette-item");
|
||||
// Should have fewer than 18 after filtering
|
||||
expect(items.length).toBeLessThan(18);
|
||||
expect(items.length).toBeGreaterThan(0);
|
||||
});
|
||||
|
||||
it("should close on Escape key", async () => {
|
||||
await browser.keys("Escape");
|
||||
await browser.pause(300);
|
||||
|
||||
const backdrop = await $(".palette-backdrop");
|
||||
if (await backdrop.isExisting()) {
|
||||
const display = await backdrop.getCSSProperty("display");
|
||||
expect(display.value).toBe("none");
|
||||
}
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue