1
14import { test, expect } from "../fixtures";
15
16test.describe("Spaces directory — P1 (T-136/T-137)", () => {
17 test("list → archive → archived view → restore round-trip", async ({
18 authPage,
19 freshWorkspace
20 }) => {
21 const ws = await freshWorkspace("Spaces E2E Roundtrip");
22 const item = authPage.getByTestId(`space-item-${ws.id}`);
23
24
25 await authPage.goto("/spaces");
26 await expect(authPage.getByRole("heading", { name: /^spaces$/i })).toBeVisible();
27 await expect(item).toBeVisible({ timeout: 15_000 });
28 await expect(item).toContainText("Spaces E2E Roundtrip");
29
30
31 await authPage.getByTestId("spaces-search").fill("Spaces E2E Roundtrip");
32 await expect(item).toBeVisible();
33
34
35 await item.getByTestId(`space-archive-${ws.id}`).click();
36
37 await expect(item).toHaveCount(0, { timeout: 10_000 });
38
39
40 await authPage.getByTestId("spaces-show-archived").check();
41 await expect(item).toBeVisible({ timeout: 15_000 });
42 await expect(item).toContainText("Archived");
43 await expect(item.getByTestId(`space-restore-${ws.id}`)).toBeVisible();
44
45
46 await item.getByTestId(`space-restore-${ws.id}`).click();
47 await authPage.getByTestId("spaces-show-archived").uncheck();
48 await expect(item).toBeVisible({ timeout: 15_000 });
49 });
50});
51