From a1db9eb40a13ae14498be2a21ad553da32ad38e2 Mon Sep 17 00:00:00 2001 From: Carlos Scheidegger Date: Sat, 11 Jan 2025 10:12:01 -0500 Subject: [PATCH] add playwright test for no JS errors on TOC --- .../playwright/tests/html-toc-js.spec.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 tests/integration/playwright/tests/html-toc-js.spec.ts diff --git a/tests/integration/playwright/tests/html-toc-js.spec.ts b/tests/integration/playwright/tests/html-toc-js.spec.ts new file mode 100644 index 0000000000..9c4cbaa356 --- /dev/null +++ b/tests/integration/playwright/tests/html-toc-js.spec.ts @@ -0,0 +1,14 @@ +import { expect, Page, test } from "@playwright/test"; + +const testPages = { + 'posts': 'table.html', +}; + +test("toc navigation doesn't crash", async ({ page }) => { + const messages: string[] = []; + page.on('pageerror', (error) => { + messages.push(`[${error.name}] ${error.message}`); + }); + await page.goto('./blog/simple-blog/_site/posts/post-with-code/index.html'); + expect(messages).toStrictEqual([]); +});