test: cover more aria escaping edge cases (#33463)

This commit is contained in:
Pavel Feldman 2024-11-06 08:31:32 -08:00 committed by GitHub
parent 8c4738ab1a
commit 2f8a14c6e2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 14 additions and 1 deletions

View File

@ -441,12 +441,21 @@ test('should unpack escaped names', async ({ page }) => {
await expect(page.locator('body')).toMatchAriaSnapshot(`
- button "Click \\\" me"
`);
await expect(page.locator('body')).toMatchAriaSnapshot(`
- button /Click \" me/
`);
await expect(page.locator('body')).toMatchAriaSnapshot(`
- button /Click \\\" me/
`);
}
{
await page.setContent(`
<button>Click \\ me</button>
`);
await expect(page.locator('body')).toMatchAriaSnapshot(`
- button "Click \\\\ me"
`);
await expect(page.locator('body')).toMatchAriaSnapshot(`
- button /Click \\\\ me/
`);

View File

@ -167,7 +167,9 @@ test('should generate baseline with special characters', async ({ runInlineTest
<button>Click ' me</button>
<button>Click: ' me</button>
<button>Click " me</button>
<button>Click " me 123</button>
<button>Click \\\\ me</button>
<button>Click \\\\ me 123</button>
<li>Item: 1</li>
<li>Item {a: b}</li>
</ul>\`);
@ -181,7 +183,7 @@ test('should generate baseline with special characters', async ({ runInlineTest
const data = fs.readFileSync(patchPath, 'utf-8');
expect(data).toBe(`--- a/a.spec.ts
+++ b/a.spec.ts
@@ -11,6 +11,16 @@
@@ -13,6 +13,18 @@
<li>Item: 1</li>
<li>Item {a: b}</li>
</ul>\`);
@ -193,7 +195,9 @@ test('should generate baseline with special characters', async ({ runInlineTest
+ - button "Click ' me"
+ - 'button "Click: '' me"'
+ - button "Click \\\\" me"
+ - button /Click " me \\\\d+/
+ - button "Click \\\\\\\\ me"
+ - button /Click \\\\\\\\ me \\\\d+/
+ - listitem: \"Item: 1\"
+ - listitem: \"Item {a: b}\"
+ \`);