Preserve memo drafts and stabilize goal tree selection
Some checks failed
Deploy Sokko G / deploy (push) Failing after 2s

This commit is contained in:
Shinuwa 2026-09-11 13:58:00 +02:00
parent b9cc77a4d1
commit 4f644ca116
8 changed files with 158 additions and 49 deletions

View file

@ -1,4 +1,5 @@
// Rôle : couvre les parcours navigateur principaux des toolboxes locales.
/* global window, CustomEvent */
import { expect, test } from "@playwright/test";
import path from "node:path";
import { fileURLToPath } from "node:url";
@ -62,6 +63,31 @@ test("creates a toolbox and lazy-loads an added tool", async ({ page }) => {
await expect(page.locator("[data-module-type='goalTree']")).toBeVisible();
});
test("keeps an uncommitted memo through unrelated app updates and saves multiline text", async ({ page }) => {
await createToolbox(page, "Memo draft toolbox");
const memos = moduleByType(page, "memos");
const editor = memos.getByRole("textbox", { name: "Modifier le mémo" }).first();
await editor.fill("Premiere ligne\nDeuxieme ligne");
await page.evaluate(() => window.dispatchEvent(new CustomEvent("sokkog:notify", {
detail: { message: "Memo draft notification" }
})));
await expect(page.getByText("Memo draft notification", { exact: true })).toBeVisible();
await expect(editor).toHaveValue("Premiere ligne\nDeuxieme ligne");
await editor.press("End");
await editor.press("Enter");
await editor.pressSequentially("Troisieme ligne");
await editor.blur();
await expect(editor).toHaveValue("Premiere ligne\nDeuxieme ligne\nTroisieme ligne");
await page.reload();
await expect(editor).toHaveValue("Premiere ligne\nDeuxieme ligne\nTroisieme ligne");
await editor.fill(" Premiere ligne\nDeuxieme ligne\nTroisieme ligne ");
await editor.blur();
await expect(editor).toHaveValue("Premiere ligne\nDeuxieme ligne\nTroisieme ligne");
await editor.fill(" ");
await editor.blur();
await expect(memos.locator(".memo-card")).toHaveCount(0);
});
test("creates, edits and deletes a weekly calendar event", async ({ page }) => {
await createToolbox(page, "Calendar E2E Toolbox");
await addTool(page, "Calendrier");