Name the chrome's language menu and guard anchor positioning in the fallback
CI / full-gate (push) Successful in 2m44s
CI / full-gate (push) Successful in 2m44s
This commit is contained in:
@@ -65,8 +65,10 @@ test("data-table renders sortable headers, row-select, typed cells, badges and k
|
||||
|
||||
// Kebab row actions: a popover trigger and the panel it opens, named per row, then link item,
|
||||
// danger button, separator.
|
||||
assert.match(html, /<td class="col-actions"><span class="menu"><button class="kebab" type="button" popovertarget="row-actions-1" aria-label="Row actions for Mara Delgado"><svg class="ico ico-sm"><use href="#i-kebab"\s*\/?><\/svg><\/button><div id="row-actions-1" class="menu-pop" popover>/);
|
||||
assert.match(html, /<td class="col-actions"><div class="menu"><button class="kebab" type="button" popovertarget="row-actions-1" aria-label="Row actions for Mara Delgado"><svg class="ico ico-sm"><use href="#i-kebab"\s*\/?><\/svg><\/button><div id="row-actions-1" class="menu-pop" popover>/);
|
||||
assert.match(html, /<a class="menu-item" href="\/people\/1\/edit"><svg class="ico"><use href="#i-edit"\s*\/?><\/svg>Edit<\/a>/);
|
||||
// actionsId renames the stem, so two tables can share a page without colliding.
|
||||
assert.match(flat(await render({ ...config, actionsId: "people-actions" })), /popovertarget="people-actions-1"/);
|
||||
assert.match(html, /<div class="menu-sep"><\/div><button class="menu-item danger" type="button"><svg class="ico"><use href="#i-trash"\s*\/?><\/svg>Delete<\/button>/);
|
||||
});
|
||||
|
||||
|
||||
+2
-2
@@ -30,7 +30,7 @@ test("menu renders trigger, positioning, the item matrix and check groups", asyn
|
||||
|
||||
// Trigger: icon + text + aria-label, wired to the panel by id; popover carries align/up + width.
|
||||
// The panel is the trigger's next sibling inside the wrapper — the CSS open state reads that.
|
||||
assert.match(html, /<span class="menu"><button class="btn" type="button" popovertarget="cols-menu" aria-label="Column settings"><svg class="ico ico-sm"><use href="#i-cols"\s*\/?><\/svg>Columns<\/button><div id="cols-menu" class="menu-pop left up" popover style="min-width:240px">/);
|
||||
assert.match(html, /<div class="menu"><button class="btn" type="button" popovertarget="cols-menu" aria-label="Column settings"><svg class="ico ico-sm"><use href="#i-cols"\s*\/?><\/svg>Columns<\/button><div id="cols-menu" class="menu-pop left up" popover style="min-width:240px">/);
|
||||
|
||||
// Item matrix: head, button-with-icon, link, separator, danger button.
|
||||
assert.match(html, /<div class="menu-head">Actions<\/div>/);
|
||||
@@ -57,7 +57,7 @@ test("menu supports a raw/kebab trigger, escapes labels, and renders empty by de
|
||||
assert.match(flat(await render({ id: "esc-menu", trigger: { text: "<x>" }, items: [{ label: "<y>" }] })), /<x><\/button>.*<y>/);
|
||||
|
||||
// Only an id → a valid empty menu, never throws.
|
||||
assert.equal(flat(await render({ id: "m" })), '<span class="menu"><button class="btn" type="button" popovertarget="m"></button><div id="m" class="menu-pop" popover></div></span>');
|
||||
assert.equal(flat(await render({ id: "m" })), '<div class="menu"><button class="btn" type="button" popovertarget="m"></button><div id="m" class="menu-pop" popover></div></div>');
|
||||
});
|
||||
|
||||
test("menu demands an id — a trigger wired to nothing is a dead button, so say so", async () => {
|
||||
|
||||
@@ -42,9 +42,10 @@ test("app shell renders sidebar, topbar and the content slot", async () => {
|
||||
// The profile trigger opens that panel — the browser dismisses it on a click outside or Esc.
|
||||
assert.match(html, /<button class="profile" type="button" popovertarget="profile-menu">/);
|
||||
assert.match(html, /<div id="profile-menu" class="menu-pop left up" popover/);
|
||||
// …and Sign out is the panel's only control: nothing dead sits beside it. The panel spans from
|
||||
// its id to the close of that one form; the trigger button is before it.
|
||||
const profileMenu = html.slice(html.indexOf('id="profile-menu"'), html.indexOf("</form>"));
|
||||
// …and Sign out is the panel's only control: nothing dead sits beside it. The window runs to the
|
||||
// sidebar's end so a control added *after* the form is caught too (this render has no picker —
|
||||
// ENGLISH_LOCALS ships one locale, so locale-switch emits nothing).
|
||||
const profileMenu = html.slice(html.indexOf('id="profile-menu"'), html.indexOf("</aside>"));
|
||||
assert.deepEqual(profileMenu.match(/<button/g), ["<button"]);
|
||||
|
||||
// Branding, document title, and the inlined icon sprite (so <use> resolves).
|
||||
|
||||
Reference in New Issue
Block a user