test: fix 'should climb up to a anchor' test in Firefox (#14275)

This commit is contained in:
Max Schmitt 2022-05-19 16:23:31 +03:00 committed by GitHub
parent 679eee9d46
commit 4af778fa46
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -612,7 +612,8 @@ it('should climb up to [role=button]', async ({ page }) => {
});
it('should climb up to a anchor', async ({ page }) => {
await page.setContent(`<a href="javascript:window.__CLICKED=true;" id="outer"><div id="inner" style="pointer-events: none">Inner</div></a>`);
// For Firefox its not allowed to return anything: https://bugzilla.mozilla.org/show_bug.cgi?id=1392046
await page.setContent(`<a href="javascript:(function(){window.__CLICKED=true})()" id="outer"><div id="inner" style="pointer-events: none">Inner</div></a>`);
await page.click('#inner');
expect(await page.evaluate('__CLICKED')).toBe(true);
});