Refine toolbox navigation and local data controls
All checks were successful
Deploy Sokko G / deploy (push) Successful in 20s

This commit is contained in:
Shinuwa 2026-10-15 10:52:34 +02:00
parent 954240adf9
commit 2f2e79d200
27 changed files with 614 additions and 302 deletions

View file

@ -65,11 +65,17 @@ async function disk(page) {
}
async function exportJson(page, buttonName = "Exporter tout") {
const globalExport = buttonName === "Exporter tout";
const management = page.getByRole("dialog", { name: "Données et préférences" });
if (globalExport && !await management.isVisible()) {
await page.getByRole("button", { name: "Données et préférences", exact: true }).click();
}
const download = page.waitForEvent("download");
await page.getByRole("button", { name: buttonName, exact: true }).click();
await (globalExport ? management : page).getByRole("button", { name: buttonName, exact: true }).click();
const stream = await (await download).createReadStream();
const chunks = [];
for await (const chunk of stream) chunks.push(chunk);
if (globalExport) await management.getByRole("button", { name: "Fermer", exact: true }).last().click();
return JSON.parse(Buffer.concat(chunks).toString());
}
@ -180,7 +186,8 @@ test("failed media exports produce no partial download and can be retried", asyn
const downloads = [];
page.on("download", (download) => downloads.push(download));
await page.evaluate(() => { window.failedMediaKey = "b:images"; });
await page.getByRole("button", { name: "Exporter tout", exact: true }).click();
await page.getByRole("button", { name: "Données et préférences", exact: true }).click();
await page.getByRole("dialog", { name: "Données et préférences" }).getByRole("button", { name: "Exporter tout", exact: true }).click();
const dialog = page.getByRole("dialog", { name: "Erreur de stockage local" });
await expect(dialog).toBeVisible();
expect(downloads).toHaveLength(0);