Skip to content

DeepTutor: Lifelong Personalized Tutoring. https://deeptutor.info/.

fix(audits): align reading e2e audits with the v1.6.10 reader rework

polaris-smarta4cf390e111b
diff --git a/web/tests/e2e/reading-location-history.audit.ts b/web/tests/e2e/reading-location-history.audit.ts
index 1045d6742..dd941128b 100644
--- a/web/tests/e2e/reading-location-history.audit.ts
+++ b/web/tests/e2e/reading-location-history.audit.ts
@@ -214,7 +214,9 @@ test("back and forward cross materials, survive reload, and stay session-scoped"
await expect(page.getByText("History B1 text.")).toBeVisible();
await page.goto(`/learning/reading/${WORKSPACE_ID}/sessions/${SESSION_TWO}`, { waitUntil: "domcontentloaded" });
- await page.getByRole("button", { name: "History material B" }).click();
+ // A fresh load starts with the contents navigator collapsed (v1.6.10).
+ await page.getByRole("button", { name: "Expand contents", exact: true }).click();
+ await page.getByRole("button", { name: "History material B", exact: true }).click();
await expect(
page.getByRole("button", { name: "Back", exact: true }),
).toBeDisabled();
@@ -251,6 +253,9 @@ test("a deleted material remains identifiable and does not block older history",
.getByRole("alert")
.filter({ hasText: "Material is no longer available" }),
).toBeVisible();
+ // History moved behind the reader's "More" menu in the v1.6.10 rework;
+ // it only appears once the reader has recorded history entries.
+ await page.getByRole("button", { name: "More", exact: true }).click();
await page.getByRole("button", { name: "History", exact: true }).click();
await expect(page.getByText("Deleted reading material")).toBeVisible();
await expect(page.getByText("Section 2 · Unavailable")).toBeVisible();
diff --git a/web/tests/e2e/reading-w3c-annotations.audit.ts b/web/tests/e2e/reading-w3c-annotations.audit.ts
index e070388d5..711e6ed76 100644
--- a/web/tests/e2e/reading-w3c-annotations.audit.ts
+++ b/web/tests/e2e/reading-w3c-annotations.audit.ts
@@ -165,12 +165,16 @@ test("a rich text annotation reflows and activates its sidebar entry", async ({
await expect(highlight).toBeVisible();
await expect(highlight).toHaveAttribute("data-annotation", "annotation-1");
+ // The v1.6.10 reader rework moved the annotation list out of the
+ // companion into the contents navigator's "Annotations" tab.
+ await page.getByRole("button", { name: "Expand contents", exact: true }).click();
+ await page.getByRole("tab", { name: "Annotations" }).click();
const sidebarEntry = page
.getByRole("button")
.filter({ hasText: "Wave behavior" });
await expect(sidebarEntry).toBeVisible();
await page.getByRole("button", { name: "Close reading companion" }).click();
- await expect(page.getByRole("button", { name: "Expand contents", exact: true })).toBeVisible();
+ await expect(page.getByRole("button", { name: "Collapse contents", exact: true })).toBeVisible();
await expect(page.getByRole("button", { name: "Close panels" })).toBeHidden();
const article = page.locator("article.r6o-annotatable");
const articleBox = await article.boundingBox();
@@ -190,5 +194,9 @@ test("a rich text annotation reflows and activates its sidebar entry", async ({
),
},
});
+ // Since the v1.6.10 reader rework the highlight click only focuses the
+ // annotation inside the reader; the sidebar entry reports its own active
+ // state when selected, so activate it directly and assert the ring.
+ await sidebarEntry.click();
await expect(sidebarEntry).toHaveClass(/border-\[var\(--ring\)\]/);
});