feat: add ephemeral webcam faces and adaptive screens
This commit is contained in:
@@ -225,6 +225,28 @@ describe("profile editor DOM adapter", () => {
|
||||
assert.equal(saves.length, 1);
|
||||
});
|
||||
|
||||
it("includes visible contextual controls in its focus trap and skips hidden ones", () => {
|
||||
const { document, editor } = setup();
|
||||
const cameraStart = document.createElement("button");
|
||||
const cameraStop = document.createElement("button");
|
||||
cameraStop.hidden = true;
|
||||
editor.registerFocusables([
|
||||
cameraStart as unknown as HTMLElement,
|
||||
cameraStop as unknown as HTMLElement,
|
||||
]);
|
||||
editor.open();
|
||||
const root = editor.root as unknown as FakeElement;
|
||||
const first = root.find("data-field", "displayName");
|
||||
cameraStart.focus();
|
||||
assert.equal(root.dispatch("keydown", { key: "Tab" }).defaultPrevented, true);
|
||||
assert.equal(document.activeElement, first);
|
||||
cameraStart.hidden = true;
|
||||
const save = root.find("data-action", "save");
|
||||
save.focus();
|
||||
assert.equal(root.dispatch("keydown", { key: "Tab" }).defaultPrevented, true);
|
||||
assert.equal(document.activeElement, first);
|
||||
});
|
||||
|
||||
it("strictly updates caller data, then disposes without leaving DOM", () => {
|
||||
const { container, editor, previews } = setup();
|
||||
const next = createDefaultLocalProfile("new-person", "Morgan");
|
||||
|
||||
Reference in New Issue
Block a user