Skip to content

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

test(reading): use current companion toggle in annotation audit

Bingxi Zhao (Frank)745931007419
diff --git a/web/tests/e2e/reading-w3c-annotations.audit.ts b/web/tests/e2e/reading-w3c-annotations.audit.ts
index 711e6ed76..d9187e2e5 100644
--- a/web/tests/e2e/reading-w3c-annotations.audit.ts
+++ b/web/tests/e2e/reading-w3c-annotations.audit.ts
@@ -173,7 +173,12 @@ test("a rich text annotation reflows and activates its sidebar entry", async ({
.getByRole("button")
.filter({ hasText: "Wave behavior" });
await expect(sidebarEntry).toBeVisible();
- await page.getByRole("button", { name: "Close reading companion" }).click();
+ const companionToggle = page.getByRole("button", {
+ name: "Reading companion",
+ exact: true,
+ });
+ await companionToggle.click();
+ await expect(companionToggle).toHaveAttribute("aria-expanded", "false");
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");