Make language selector also search through the languages' filename suffixes (using the guesslang attribute)

This makes the "cpp" string match C++, and "cs" match C#.
This commit is contained in:
Jonatan Heyman
2025-01-03 15:43:17 +01:00
parent ff88091e28
commit c87ea672b0
2 changed files with 21 additions and 3 deletions

View File

@ -0,0 +1,16 @@
import { test, expect } from "@playwright/test";
import { HeynotePage } from "./test-utils.js";
let heynotePage
test.beforeEach(async ({ page }) => {
heynotePage = new HeynotePage(page)
await heynotePage.goto()
})
test("test language selector search by file ending", async ({ page }) => {
await page.locator("body").press(heynotePage.agnosticKey("Mod+L"))
await page.locator("body").pressSequentially("cpp")
await expect(page.locator("css=.language-selector .items > li.selected")).toHaveText("C++")
})