Improve compact desktop usability and action guidance
All checks were successful
Deploy Sokko G / deploy (push) Successful in 19s
All checks were successful
Deploy Sokko G / deploy (push) Successful in 19s
This commit is contained in:
parent
0ac1a0974e
commit
0fc18cd8b9
24 changed files with 325 additions and 90 deletions
|
|
@ -21,26 +21,22 @@ async function setup(page, probe = false) {
|
|||
await page.clock.pauseAt(new Date("2026-09-12T12:00:01Z"));
|
||||
}
|
||||
|
||||
async function notify(page, message, durationMs) {
|
||||
await page.evaluate((detail) => window.dispatchEvent(new CustomEvent("sokkog:notify", { detail })), { message, durationMs });
|
||||
async function notify(page, message, options = {}) {
|
||||
await page.evaluate((detail) => window.dispatchEvent(new CustomEvent("sokkog:notify", { detail })), { message, ...options });
|
||||
await expect(page.getByRole("status").filter({ hasText: message })).toBeVisible();
|
||||
}
|
||||
|
||||
test("application alerts use short clipboard and default durations and dismiss individually", async ({ page }) => {
|
||||
test("ordinary alerts last six seconds while explicit and persistent durations are respected", async ({ page }) => {
|
||||
await setup(page);
|
||||
await notify(page, "Texte copié");
|
||||
await notify(page, "Sauvegarde terminée");
|
||||
await page.clock.runFor(4999);
|
||||
await page.clock.runFor(5999);
|
||||
await expect(page.getByRole("status")).toHaveCount(2);
|
||||
await page.clock.runFor(1);
|
||||
await expect(page.getByRole("status")).toHaveText("Sauvegarde terminée");
|
||||
await page.clock.runFor(114999);
|
||||
await expect(page.getByRole("status")).toHaveCount(1);
|
||||
await page.clock.runFor(1);
|
||||
await expect(page.getByRole("status")).toHaveCount(0);
|
||||
|
||||
await notify(page, "Minimum", 0);
|
||||
await notify(page, "Personnalisée", 2000);
|
||||
await notify(page, "Minimum", { durationMs: 0 });
|
||||
await notify(page, "Personnalisée", { durationMs: 2000 });
|
||||
await page.clock.runFor(999);
|
||||
await expect(page.getByRole("status")).toHaveCount(2);
|
||||
await page.clock.runFor(1);
|
||||
|
|
@ -49,6 +45,17 @@ test("application alerts use short clipboard and default durations and dismiss i
|
|||
await expect(page.getByRole("status")).toHaveCount(0);
|
||||
await page.clock.runFor(2000);
|
||||
await expect(page.getByRole("status")).toHaveCount(0);
|
||||
|
||||
await notify(page, "Alerte persistante", { persistent: true });
|
||||
await page.clock.runFor(120000);
|
||||
await expect(page.getByRole("status")).toHaveText("Alerte persistante");
|
||||
await page.getByRole("button", { name: "Fermer l'alerte" }).click();
|
||||
await expect(page.getByRole("status")).toHaveCount(0);
|
||||
|
||||
for (let index = 1; index <= 6; index += 1) await notify(page, `Pile ${index}`);
|
||||
await expect(page.getByRole("status")).toHaveCount(5);
|
||||
await expect(page.getByRole("status").filter({ hasText: "Pile 1" })).toHaveCount(0);
|
||||
await expect(page.getByRole("status").filter({ hasText: "Pile 6" })).toBeVisible();
|
||||
});
|
||||
|
||||
test("toast replacement and unmount cancel obsolete expiration callbacks under StrictMode", async ({ page }) => {
|
||||
|
|
@ -60,12 +67,17 @@ test("toast replacement and unmount cancel obsolete expiration callbacks under S
|
|||
expect(await page.evaluate(() => window.shellProbe.closed)).toEqual([]);
|
||||
await page.clock.runFor(1);
|
||||
expect(await page.evaluate(() => window.shellProbe.closed)).toEqual(["new"]);
|
||||
await page.evaluate(() => window.shellProbe.render({ toast: { id: "default", message: "Par défaut" } }));
|
||||
await page.clock.runFor(5999);
|
||||
expect(await page.evaluate(() => window.shellProbe.closed)).toEqual(["new"]);
|
||||
await page.clock.runFor(1);
|
||||
expect(await page.evaluate(() => window.shellProbe.closed)).toEqual(["new", "default"]);
|
||||
await page.evaluate(() => {
|
||||
window.shellProbe.render({ toast: { id: "unmounted", message: "Fermée" } });
|
||||
window.shellProbe.unmount();
|
||||
});
|
||||
await page.clock.runFor(120000);
|
||||
expect(await page.evaluate(() => window.shellProbe.closed)).toEqual(["new"]);
|
||||
expect(await page.evaluate(() => window.shellProbe.closed)).toEqual(["new", "default"]);
|
||||
});
|
||||
|
||||
test("overlapping modals keep scroll locked until the last unmount under StrictMode", async ({ page }) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue