Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Bruno Prieto <[email protected]>
  • Loading branch information
leofeyer and brunoprietog authored Jan 10, 2025
1 parent 784576e commit 8a7e973
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/core/url.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export function getExtension(url) {
}

export function isPrefixedBy(baseURL, url) {
const prefix = getPrefix(url) || '/'
const prefix = getPrefix(url) || "/"
return baseURL.href === expandURL(prefix).href || baseURL.href.startsWith(prefix)
}

Expand Down
6 changes: 3 additions & 3 deletions src/tests/functional/root_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@ import { test } from "@playwright/test"
import { assert } from "chai"
import { nextBody, pathname, visitAction } from "../helpers/page"

test("test visiting a location inside the root", async ({ page }) => {
test("visiting a location inside the root", async ({ page }) => {
page.goto("/src/tests/fixtures/root/index.html")
page.click("#link-page-inside")
await nextBody(page)
assert.equal(pathname(page.url()), "/src/tests/fixtures/root/page.html")
assert.notEqual(await visitAction(page), "load")
})

test("test visiting the root itself", async ({ page }) => {
test("visiting the root itself", async ({ page }) => {
page.goto("/src/tests/fixtures/root/page.html")
page.click("#link-root")
await nextBody(page)
assert.equal(pathname(page.url()), "/src/tests/fixtures/root/")
assert.notEqual(await visitAction(page), "load")
})

test("test visiting a location outside the root", async ({ page }) => {
test("visiting a location outside the root", async ({ page }) => {
page.goto("/src/tests/fixtures/root/index.html")
page.click("#link-page-outside")
await nextBody(page)
Expand Down

0 comments on commit 8a7e973

Please sign in to comment.