fix test failures, new export/backup solutions

This commit is contained in:
Zimeng Xiong
2026-02-06 22:21:19 -08:00
parent f462b2e288
commit 08135ee36a
26 changed files with 4049 additions and 4087 deletions
+24 -7
View File
@@ -145,9 +145,10 @@ test.describe("Dashboard Workflows", () => {
await page.goto("/");
await page.waitForLoadState("networkidle");
await applyDashboardSearch(page, prefix);
await expect(page.locator("[id^='drawing-card-']")).toHaveCount(2);
await ensureCardSelected(page, first.id);
await ensureCardSelected(page, second.id);
// Select all filtered cards (2) for a deterministic bulk action.
await page.getByTitle("Select All").click();
await page.getByTitle("Duplicate Selected").click();
@@ -156,16 +157,32 @@ test.describe("Dashboard Workflows", () => {
return results.length;
}).toBe(4);
const allPrefixDrawings = await listDrawings(request, { search: prefix });
for (const drawing of allPrefixDrawings) {
await ensureCardSelected(page, drawing.id);
await applyDashboardSearch(page, prefix);
await expect(page.locator("[id^='drawing-card-']")).toHaveCount(4);
const bulkMoveToTrash = async () => {
await page.getByTitle("Select All").click();
await expect(page.getByTitle("Move to Trash")).toBeEnabled();
await page.getByTitle("Move to Trash").click();
};
// Move all 4. If one is missed due transient selection flake, recover with extra passes.
await bulkMoveToTrash();
for (let i = 0; i < 2; i++) {
const remaining = await listDrawings(request, { search: prefix });
if (remaining.length === 0) break;
await applyDashboardSearch(page, prefix);
await page.waitForTimeout(400);
const visibleCount = await page.locator("[id^='drawing-card-']").count();
if (visibleCount === 0) continue;
await bulkMoveToTrash();
}
await page.getByTitle("Move to Trash").click();
await expect.poll(async () => {
const trashed = await listDrawings(request, { search: prefix, collectionId: "trash" });
return trashed.length;
}).toBe(4);
}, { timeout: 15000 }).toBe(4);
const trashDrawings = await listDrawings(request, { search: prefix, collectionId: "trash" });
for (const drawing of trashDrawings) {