forked from hotwired/turbo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix navigation to the turbo-root not using Turbo Drive
closes hotwired#912
- Loading branch information
1 parent
4593d06
commit e74c798
Showing
4 changed files
with
65 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<!DOCTYPE html> | ||
<html id="html"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>Turbo</title> | ||
<script src="/dist/turbo.es2017-umd.js" data-turbo-track="reload"></script> | ||
<script src="/src/tests/fixtures/test.js"></script> | ||
<meta name="turbo-root" content="/src/tests/fixtures/root"> | ||
</head> | ||
<body> | ||
<section> | ||
<h1>Root</h1> | ||
<p><a id="link-page-inside" href="/src/tests/fixtures/root/page.html">Link to page inside root</a></p> | ||
<p><a id="link-page-outside" href="/src/tests/fixtures/one.html">Link to page outside root</a></p> | ||
</section> | ||
|
||
<div id="messages"></div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<!DOCTYPE html> | ||
<html id="html"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>Turbo</title> | ||
<script src="/dist/turbo.es2017-umd.js" data-turbo-track="reload"></script> | ||
<script src="/src/tests/fixtures/test.js"></script> | ||
<meta name="turbo-root" content="/src/tests/fixtures/root"> | ||
</head> | ||
<body> | ||
<section> | ||
<h1>Root</h1> | ||
<p><a id="link-root" href="/src/tests/fixtures/root">Link to root</a></p> | ||
</section> | ||
|
||
<div id="messages"></div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
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 }) => { | ||
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 }) => { | ||
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 }) => { | ||
page.goto("/src/tests/fixtures/root/index.html") | ||
page.click("#link-page-outside") | ||
await nextBody(page) | ||
assert.equal(pathname(page.url()), "/src/tests/fixtures/one.html") | ||
assert.equal(await visitAction(page), "load") | ||
}) |