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
5de4f5a2
Commit
5de4f5a2
authored
Sep 30, 2025
by
Niklas Mischkulnig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make nonce test more reliable
parent
1a9ee198
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
26 deletions
+18
-26
index.test.ts
test/e2e/app-dir/app/index.test.ts
+18
-26
No files found.
test/e2e/app-dir/app/index.test.ts
View file @
5de4f5a2
...
@@ -1719,15 +1719,12 @@ describe('app dir - basic', () => {
...
@@ -1719,15 +1719,12 @@ describe('app dir - basic', () => {
expect
(
element
.
attribs
.
nonce
).
toBeTruthy
()
expect
(
element
.
attribs
.
nonce
).
toBeTruthy
()
})
})
if
(
!
isNextDev
)
{
const
browser
=
await
next
.
browser
(
'/script-nonce'
)
const
browser
=
await
next
.
browser
(
'/script-nonce'
)
await
retry
(
async
()
=>
{
await
browser
.
elementByCss
(
'#get-order'
).
click
()
await
retry
(
async
()
=>
{
const
order
=
JSON
.
parse
(
await
browser
.
elementByCss
(
'#order'
).
text
())
await
browser
.
elementByCss
(
'#get-order'
).
click
()
expect
(
order
).
toEqual
([
2
,
1
])
const
order
=
JSON
.
parse
(
await
browser
.
elementByCss
(
'#order'
).
text
())
})
expect
(
order
?.
length
).
toBe
(
2
)
})
}
})
})
it
(
'should pass manual `nonce`'
,
async
()
=>
{
it
(
'should pass manual `nonce`'
,
async
()
=>
{
...
@@ -1745,15 +1742,12 @@ describe('app dir - basic', () => {
...
@@ -1745,15 +1742,12 @@ describe('app dir - basic', () => {
expect
(
element
.
attribs
.
nonce
).
toBeTruthy
()
expect
(
element
.
attribs
.
nonce
).
toBeTruthy
()
})
})
if
(
!
isNextDev
)
{
const
browser
=
await
next
.
browser
(
'/script-manual-nonce'
)
const
browser
=
await
next
.
browser
(
'/script-manual-nonce'
)
await
retry
(
async
()
=>
{
await
browser
.
elementByCss
(
'#get-order'
).
click
()
await
retry
(
async
()
=>
{
const
order
=
JSON
.
parse
(
await
browser
.
elementByCss
(
'#order'
).
text
())
await
browser
.
elementByCss
(
'#get-order'
).
click
()
expect
(
order
).
toEqual
([
2
,
1
])
const
order
=
JSON
.
parse
(
await
browser
.
elementByCss
(
'#order'
).
text
())
})
expect
(
order
?.
length
).
toBe
(
2
)
})
}
})
})
it
(
'should pass manual `nonce` pages'
,
async
()
=>
{
it
(
'should pass manual `nonce` pages'
,
async
()
=>
{
...
@@ -1771,14 +1765,12 @@ describe('app dir - basic', () => {
...
@@ -1771,14 +1765,12 @@ describe('app dir - basic', () => {
expect
(
element
.
attribs
.
nonce
).
toBeTruthy
()
expect
(
element
.
attribs
.
nonce
).
toBeTruthy
()
})
})
if
(
!
isNextDev
)
{
const
browser
=
await
next
.
browser
(
'/pages-script-manual-nonce'
)
await
retry
(
async
()
=>
{
await
retry
(
async
()
=>
{
const
browser
=
await
next
.
browser
(
'/pages-script-manual-nonce'
)
await
browser
.
elementByCss
(
'#get-order'
).
click
()
await
browser
.
elementByCss
(
'#get-order'
).
click
()
const
order
=
JSON
.
parse
(
await
browser
.
elementByCss
(
'#order'
).
text
())
const
order
=
JSON
.
parse
(
await
browser
.
elementByCss
(
'#order'
).
text
())
expect
(
order
).
toEqual
([
2
,
1
])
expect
(
order
?.
length
).
toBe
(
2
)
})
})
}
})
})
it
(
'should pass nonce when using next/font'
,
async
()
=>
{
it
(
'should pass nonce when using next/font'
,
async
()
=>
{
...
...
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