Skip to content

Offline, privacy-first grammar checker. Fast, open-source, Rust-powered

hotfix(chrome-ext): another unforeseen issue with the HN tests

Elijah Pottere38cf9061010
diff --git a/packages/chrome-plugin/tests/hn.spec.ts b/packages/chrome-plugin/tests/hn.spec.ts
index 22e33176f..afcb6bc10 100644
--- a/packages/chrome-plugin/tests/hn.spec.ts
+++ b/packages/chrome-plugin/tests/hn.spec.ts
@@ -29,6 +29,9 @@ test('Hacker News wraps correctly', async ({ page }) => {
await page.waitForTimeout(2000);
await page.reload();
+ // Needed because this element has a variable height and may offset the highlight boxes by an unknown amount.
+ await page.locator('.toptext').evaluate((el) => el.remove());
+
const editor = getTextarea(page);
await replaceEditorContent(
editor,
@@ -49,6 +52,9 @@ test('Hacker News scrolls correctly', async ({ page }) => {
await page.waitForTimeout(2000);
await page.reload();
+ // Needed because this element has a variable height and may offset the highlight boxes by an unknown amount.
+ await page.locator('.toptext').evaluate((el) => el.remove());
+
const editor = getTextarea(page);
await replaceEditorContent(
editor,