Keep an open menu above the other blocks of its panel
Every direct child of a panel sits at the same stacking level, so the blocks after an open dropdown painted over its list: the bulk recycling text and buttons hid the rarity options. The block holding an open select or filter menu now rises above its neighbours, in every panel. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
8b76570e7a
commit
055f8cf17b
2 changed files with 25 additions and 0 deletions
|
|
@ -37,6 +37,15 @@ async function expectOpenMenuVisible(page, selector) {
|
|||
expect(result).toEqual({ inside: true, covered: 0 });
|
||||
}
|
||||
|
||||
// Chaque option d'un menu ouvert est bien celle qu'on toucherait en son centre : aucun voisin ne la recouvre.
|
||||
async function expectOpenOptionsOnTop(page, selector) {
|
||||
const covered = await page.locator(selector).evaluate((menu) => [...menu.querySelectorAll("[role=option]")].filter((option) => {
|
||||
const box = option.getBoundingClientRect();
|
||||
return !option.contains(menu.ownerDocument.elementFromPoint(box.left + box.width / 2, box.top + box.height / 2));
|
||||
}).map((option) => option.textContent));
|
||||
expect(covered).toEqual([]);
|
||||
}
|
||||
|
||||
// Une phase d'aura dure de 300 à 450 ms, pilotées par setTimeout : sur une machine chargée, elle peut finir avant la lecture de ses styles.
|
||||
// Figer l'horloge de la page garde chaque phase affichée le temps des assertions ; `page.clock.runFor()` passe à la suivante et `resume()` relance le temps.
|
||||
const holdRevealTimers = async (page) => page.clock.pauseAt(await page.evaluate(() => Date.now()) + 1000);
|
||||
|
|
@ -2083,9 +2092,15 @@ test("an administrator opens expeditions and a player leaves alone, follows the
|
|||
expect(triggerBox.y).toBeGreaterThan(labelBox.y + labelBox.height - 1);
|
||||
await rarityTrigger.click();
|
||||
await expectOpenMenuVisible(partner, ".nebula-recycle-box .nds-select-menu");
|
||||
// Ouvert vers le bas, sur le texte et les boutons de l'encart : chaque option reste devant eux.
|
||||
await partner.keyboard.press("Escape");
|
||||
await partner.setViewportSize({ width: 1280, height: 1500 });
|
||||
await rarityTrigger.click();
|
||||
await expectOpenOptionsOnTop(partner, ".nebula-recycle-box .nds-select-menu");
|
||||
await partner.screenshot({ path: join(tmpdir(), "sokkog-cards-recycle-rarity.png") });
|
||||
await recycleBox.getByRole("option", { name: "Légendaire", exact: true }).click();
|
||||
await expect(rarityTrigger).toHaveText("Légendaire");
|
||||
await partner.setViewportSize({ width: 1280, height: 720 });
|
||||
await partner.getByRole("navigation", { name: "Sections de Sokko TCG" }).getByRole("link", { name: "Historique", exact: true }).click();
|
||||
await expect(partner.locator(".nebula-history-list li").filter({ hasText: "Expédition terminée" })).toContainText("★ · 2 h");
|
||||
// Alertes Discord : désactivées tant que le joueur ne les active pas, une par une.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue