mirror of
https://github.com/vector-im/element-call.git
synced 2026-10-07 23:15:50 +00:00
Cut the menu's comments down to what the code does not say
- Drop the title prop: no caller passes it, and the menu's name is for screen readers only. - One line each for the output options, the Default placeholder id and the list's height bounds. - Keep only the two non-obvious reasons behind the focus tracking. - Call what moved the focus its source rather than its modality. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -111,7 +111,7 @@ test("keeps every device reachable in a small container", async ({ page }) => {
|
||||
await expect(last).toHaveAttribute("aria-checked", "true");
|
||||
});
|
||||
|
||||
test("tracks the focus modality of its own call, not the page", async ({
|
||||
test("tracks the focus source of its own call, not the page", async ({
|
||||
page,
|
||||
}) => {
|
||||
await installFakeDevices(page);
|
||||
@@ -124,7 +124,7 @@ test("tracks the focus modality of its own call, not the page", async ({
|
||||
timeout: 60_000,
|
||||
});
|
||||
await openDeviceList(page, pane);
|
||||
// The menu owns the modality, because every item it can focus has to answer
|
||||
// The menu owns the focus source, because every item it can focus has to answer
|
||||
// to it — the device rows and the camera menu's blur toggle alike.
|
||||
const menu = page.getByRole("menu");
|
||||
|
||||
@@ -134,7 +134,7 @@ test("tracks the focus modality of its own call, not the page", async ({
|
||||
// suppresses the browser's own reaches this menu. The paint is asserted
|
||||
// standalone instead — in the story and in audio-menu.spec.ts. What is on
|
||||
// trial here is which call the tracking answers for.
|
||||
await expect(menu).toHaveAttribute("data-focus-modality", "pointer");
|
||||
await expect(menu).toHaveAttribute("data-focus-source", "pointer");
|
||||
|
||||
// A key pressed in the other call on this page — or anywhere in the host's
|
||||
// own page — says nothing about how this menu is being used.
|
||||
@@ -143,11 +143,11 @@ test("tracks the focus modality of its own call, not the page", async ({
|
||||
new KeyboardEvent("keydown", { key: "ArrowDown", bubbles: true }),
|
||||
),
|
||||
);
|
||||
await expect(menu).toHaveAttribute("data-focus-modality", "pointer");
|
||||
await expect(menu).toHaveAttribute("data-focus-source", "pointer");
|
||||
|
||||
// A key pressed in this menu does.
|
||||
await page.keyboard.press("ArrowDown");
|
||||
await expect(menu).toHaveAttribute("data-focus-modality", "keyboard");
|
||||
await expect(menu).toHaveAttribute("data-focus-source", "keyboard");
|
||||
});
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user