Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
9553f4cb
Commit
9553f4cb
authored
Apr 11, 2026
by
Jimmy Lai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Stabilize rewrites manual href/as test
parent
25fe25b5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
20 deletions
+19
-20
index.test.ts
test/integration/rewrites-manual-href-as/test/index.test.ts
+19
-20
No files found.
test/integration/rewrites-manual-href-as/test/index.test.ts
View file @
9553f4cb
...
@@ -2,12 +2,12 @@
...
@@ -2,12 +2,12 @@
import
{
join
}
from
'path'
import
{
join
}
from
'path'
import
{
import
{
check
,
findPort
,
findPort
,
killApp
,
killApp
,
launchApp
,
launchApp
,
nextBuild
,
nextBuild
,
nextStart
,
nextStart
,
retry
,
}
from
'next-test-utils'
}
from
'next-test-utils'
import
webdriver
from
'next-webdriver'
import
webdriver
from
'next-webdriver'
...
@@ -16,6 +16,17 @@ const appDir = join(__dirname, '../')
...
@@ -16,6 +16,17 @@ const appDir = join(__dirname, '../')
let
appPort
let
appPort
let
app
let
app
const
waitForModalOnIndexPage
=
async
(
browser
)
=>
{
await
retry
(
async
()
=>
{
expect
(
await
browser
.
elementByCss
(
'#index'
).
text
()).
toBe
(
'index page'
)
expect
(
await
browser
.
hasElementByCssSelector
(
'#modal'
)).
toBeTruthy
()
expect
(
await
browser
.
eval
(
'window.beforeNav'
)).
toBe
(
1
)
expect
(
JSON
.
parse
(
await
browser
.
elementByCss
(
'#query'
).
text
())).
toEqual
({
imageId
:
'123'
,
})
})
}
const
runTests
=
()
=>
{
const
runTests
=
()
=>
{
it
(
'should allow manual href/as on index page'
,
async
()
=>
{
it
(
'should allow manual href/as on index page'
,
async
()
=>
{
const
browser
=
await
webdriver
(
appPort
,
'/'
)
const
browser
=
await
webdriver
(
appPort
,
'/'
)
...
@@ -26,12 +37,7 @@ const runTests = () => {
...
@@ -26,12 +37,7 @@ const runTests = () => {
await
browser
.
elementByCss
(
'#to-modal'
).
click
()
await
browser
.
elementByCss
(
'#to-modal'
).
click
()
expect
(
await
browser
.
elementByCss
(
'#index'
).
text
()).
toBe
(
'index page'
)
await
waitForModalOnIndexPage
(
browser
)
expect
(
await
browser
.
hasElementByCssSelector
(
'#modal'
)).
toBeTruthy
()
expect
(
await
browser
.
eval
(
'window.beforeNav'
)).
toBe
(
1
)
expect
(
JSON
.
parse
(
await
browser
.
elementByCss
(
'#query'
).
text
())).
toEqual
({
imageId
:
'123'
,
})
await
browser
await
browser
.
elementByCss
(
'#to-preview'
)
.
elementByCss
(
'#to-preview'
)
...
@@ -86,12 +92,7 @@ const runTests = () => {
...
@@ -86,12 +92,7 @@ const runTests = () => {
.
click
()
.
click
()
.
waitForElementByCss
(
'#index'
)
.
waitForElementByCss
(
'#index'
)
expect
(
await
browser
.
elementByCss
(
'#index'
).
text
()).
toBe
(
'index page'
)
await
waitForModalOnIndexPage
(
browser
)
expect
(
await
browser
.
hasElementByCssSelector
(
'#modal'
)).
toBeTruthy
()
expect
(
await
browser
.
eval
(
'window.beforeNav'
)).
toBe
(
1
)
expect
(
JSON
.
parse
(
await
browser
.
elementByCss
(
'#query'
).
text
())).
toEqual
({
imageId
:
'123'
,
})
await
browser
await
browser
.
elementByCss
(
'#to-preview'
)
.
elementByCss
(
'#to-preview'
)
...
@@ -108,13 +109,11 @@ const runTests = () => {
...
@@ -108,13 +109,11 @@ const runTests = () => {
expect
(
await
browser
.
elementByCss
(
'#preview'
).
text
()).
toBe
(
'preview page'
)
expect
(
await
browser
.
elementByCss
(
'#preview'
).
text
()).
toBe
(
'preview page'
)
expect
(
await
browser
.
eval
(
'window.beforeNav'
)).
toBe
(
1
)
expect
(
await
browser
.
eval
(
'window.beforeNav'
)).
toBe
(
1
)
await
check
(
await
retry
(
async
()
=>
{
async
()
=>
expect
(
JSON
.
parse
(
await
browser
.
elementByCss
(
'#query'
).
text
())).
toEqual
({
JSON
.
parse
(
slug
:
'321'
,
await
browser
.
eval
(
'document.querySelector("#query").innerHTML'
)
})
).
slug
,
})
'321'
)
await
browser
await
browser
.
elementByCss
(
'#to-another'
)
.
elementByCss
(
'#to-another'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment