Skip to content

Commit

Permalink
Merge pull request #955 from seanpdoyle/get-form-aria-busy
Browse files Browse the repository at this point in the history
Add test coverage toggling `[aria-busy]` for `GET` Form Submissions
  • Loading branch information
Alberto Fernández-Capel authored Aug 24, 2023
2 parents 0291998 + 49e1e2c commit 4237b84
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/tests/functional/form_submission_tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ test("test standard form submission does not render a progress bar before expiri
assert.notOk(await hasSelector(page, ".turbo-progress-bar"), "does not show progress bar before delay")
})

test("test standard form submission with redirect response", async ({ page }) => {
test("test standard POST form submission with redirect response", async ({ page }) => {
await page.click("#standard form.redirect input[type=submit]")
await nextBody(page)

Expand Down Expand Up @@ -217,6 +217,16 @@ test("test standard GET form submission", async ({ page }) => {
assert.equal(pathname(page.url()), "/src/tests/fixtures/one.html")
assert.equal(await visitAction(page), "advance")
assert.equal(getSearchParam(page.url(), "greeting"), "Hello from a form")
assert.equal(
await nextAttributeMutationNamed(page, "html", "aria-busy"),
"true",
"sets [aria-busy] on the document element"
)
assert.equal(
await nextAttributeMutationNamed(page, "html", "aria-busy"),
null,
"removes [aria-busy] from the document element"
)
})

test("test standard GET HTMLFormElement.requestSubmit() with Turbo Action", async ({ page }) => {
Expand Down Expand Up @@ -674,7 +684,7 @@ test("test frame form submission with redirect response", async ({ page }) => {
assert.equal(await page.getAttribute("#frame", "src"), url.href, "redirects the target frame")
})

test("test frame form submission toggles the ancestor frame's [aria-busy] attribute", async ({ page }) => {
test("test frame POST form submission toggles the ancestor frame's [aria-busy] attribute", async ({ page }) => {
await page.click("#frame form.redirect input[type=submit]")
await nextBeat()

Expand All @@ -688,7 +698,7 @@ test("test frame form submission toggles the ancestor frame's [aria-busy] attrib
)
})

test("test frame form submission toggles the target frame's [aria-busy] attribute", async ({ page }) => {
test("test frame POST form submission toggles the target frame's [aria-busy] attribute", async ({ page }) => {
await page.click('#targets-frame form.frame [type="submit"]')
await nextBeat()

Expand Down

0 comments on commit 4237b84

Please sign in to comment.