Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
npezza93 committed Jul 13, 2024
1 parent c591267 commit 64680d7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/tests/functional/form_submission_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ test("supports transforming a POST submission to a GET in a turbo:submit-start l
test("supports transforming a GET submission to a POST in a turbo:submit-start listener", async ({ page }) => {
await page.evaluate(() =>
addEventListener("turbo:submit-start", (({ detail }) => {
detail.formSubmission.method = "post"
detail.formSubmission.method = "POST"
detail.formSubmission.body.set("path", "/src/tests/fixtures/one.html")
detail.formSubmission.body.set("greeting", "Hello, from an event listener")
}))
Expand Down Expand Up @@ -992,7 +992,7 @@ test("link method form submission submits a single request", async ({ page }) =>
const { fetchOptions } = await nextEventNamed(page, "turbo:before-fetch-request")

assert.ok(await noNextEventNamed(page, "turbo:before-fetch-request"))
assert.equal(fetchOptions.method, "post", "[data-turbo-method] overrides the GET method")
assert.equal(fetchOptions.method, "POST", "[data-turbo-method] overrides the GET method")
assert.equal(requestCounter, 1, "submits a single HTTP request")
})

Expand All @@ -1006,7 +1006,7 @@ test("link method form submission inside frame submits a single request", async
const { fetchOptions } = await nextEventNamed(page, "turbo:before-fetch-request")

assert.ok(await noNextEventNamed(page, "turbo:before-fetch-request"))
assert.equal(fetchOptions.method, "post", "[data-turbo-method] overrides the GET method")
assert.equal(fetchOptions.method, "POST", "[data-turbo-method] overrides the GET method")
assert.equal(requestCounter, 1, "submits a single HTTP request")
})

Expand All @@ -1020,7 +1020,7 @@ test("link method form submission targeting frame submits a single request", asy
const { fetchOptions } = await nextEventNamed(page, "turbo:before-fetch-request")

assert.ok(await noNextEventNamed(page, "turbo:before-fetch-request"))
assert.equal(fetchOptions.method, "post", "[data-turbo-method] overrides the GET method")
assert.equal(fetchOptions.method, "POST", "[data-turbo-method] overrides the GET method")
assert.equal(requestCounter, 2, "submits a single HTTP request then follows a redirect")
})

Expand Down
2 changes: 1 addition & 1 deletion src/tests/functional/visit_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ test("turbo:before-fetch-request event.detail", async ({ page }) => {
await page.click("#same-origin-link")
const { url, fetchOptions } = await nextEventNamed(page, "turbo:before-fetch-request")

assert.equal(fetchOptions.method, "get")
assert.equal(fetchOptions.method, "GET")
assert.ok(url.includes("/src/tests/fixtures/one.html"))
})

Expand Down

0 comments on commit 64680d7

Please sign in to comment.