fix(frontend): use case-insensitive regex in getBlockCardByName

beautifyString capitalizes each word (e.g. "Add To Dictionary") but
tests may pass names with different casing (e.g. "Add to Dictionary").
Playwright hasText with a string is case-insensitive but with a regex
it is case-sensitive, so add the "i" flag.
This commit is contained in:
abhi1992002
2026-03-17 11:29:33 +05:30
parent 2f32217c7c
commit 54bf45656a

View File

@@ -68,7 +68,7 @@ export class BuildPage extends BasePage {
private getBlockCardByName(name: string): Locator {
const escapedName = name.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
const exactName = new RegExp(`^\\s*${escapedName}\\s*$`);
const exactName = new RegExp(`^\\s*${escapedName}\\s*$`, "i");
return this.page
.locator('[data-id^="block-card-"]')
.filter({ has: this.page.locator("span", { hasText: exactName }) })