mirror of
https://github.com/withastro/astro.git
synced 2025-01-06 22:10:10 -05:00
[ci] format
This commit is contained in:
parent
3878a91be4
commit
6404d26a22
2 changed files with 11 additions and 8 deletions
|
@ -106,8 +106,8 @@ const { fallback = 'animate' } = Astro.props;
|
||||||
|
|
||||||
// the "dialog" method is a special keyword used within <dialog> elements
|
// the "dialog" method is a special keyword used within <dialog> elements
|
||||||
// https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#attr-fs-method
|
// https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#attr-fs-method
|
||||||
if (method === "dialog") {
|
if (method === 'dialog') {
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const options: Options = { sourceElement: submitter ?? form };
|
const options: Options = { sourceElement: submitter ?? form };
|
||||||
|
|
|
@ -1075,17 +1075,20 @@ test.describe('View Transitions', () => {
|
||||||
await expect(page).toHaveURL(expected);
|
await expect(page).toHaveURL(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Dialog using form with method of "dialog" should not trigger navigation', async ({ page, astro }) => {
|
test('Dialog using form with method of "dialog" should not trigger navigation', async ({
|
||||||
|
page,
|
||||||
|
astro,
|
||||||
|
}) => {
|
||||||
await page.goto(astro.resolveUrl('/dialog'));
|
await page.goto(astro.resolveUrl('/dialog'));
|
||||||
|
|
||||||
let requests = [];
|
let requests = [];
|
||||||
page.on('request', request => requests.push(`${request.method()} ${request.url()}`));
|
page.on('request', (request) => requests.push(`${request.method()} ${request.url()}`));
|
||||||
|
|
||||||
await page.click('#open');
|
await page.click('#open');
|
||||||
await expect(page.locator("dialog")).toHaveAttribute("open")
|
await expect(page.locator('dialog')).toHaveAttribute('open');
|
||||||
await page.click('#close');
|
await page.click('#close');
|
||||||
await expect(page.locator("dialog")).not.toHaveAttribute("open")
|
await expect(page.locator('dialog')).not.toHaveAttribute('open');
|
||||||
|
|
||||||
expect(requests).toHaveLength(0)
|
expect(requests).toHaveLength(0);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue