Skip to content

Commit c7cf7d4

Browse files
committed
update test
1 parent 7b73a6d commit c7cf7d4

File tree

4 files changed

+45
-30
lines changed

4 files changed

+45
-30
lines changed

test/e2e/app-dir/app-css/index.test.ts

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -215,35 +215,6 @@ createNextDescribe(
215215
)
216216
})
217217

218-
it('should load css while navigation between not-found and page', async () => {
219-
const browser = await next.browser('/navigate')
220-
await check(
221-
async () =>
222-
await browser.eval(
223-
`window.getComputedStyle(document.querySelector('#nav-button')).backgroundColor`
224-
),
225-
'rgb(0, 128, 0)'
226-
)
227-
await browser.elementByCss('#nav-button').click()
228-
await browser.waitForElementByCss('#back')
229-
await check(
230-
async () =>
231-
await browser.eval(
232-
`window.getComputedStyle(document.querySelector('#back')).backgroundColor`
233-
),
234-
'rgb(0, 128, 0)'
235-
)
236-
await browser.elementByCss('#back').click()
237-
await browser.waitForElementByCss('#nav-button')
238-
await check(
239-
async () =>
240-
await browser.eval(
241-
`window.getComputedStyle(document.querySelector('#nav-button')).backgroundColor`
242-
),
243-
'rgb(0, 128, 0)'
244-
)
245-
})
246-
247218
it('should include css imported in server not-found.js', async () => {
248219
const browser = await next.browser('/not-found/servercomponent')
249220
await check(

test/e2e/app-dir/not-found/css-precedence/app/not-found.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ function NotFound() {
99
<div>
1010
<h1>404 - Page Not Found</h1>
1111
<Button
12+
id="go-to-index"
1213
onClick={() => {
1314
router.push('/')
1415
}}

test/e2e/app-dir/not-found/css-precedence/app/page.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default function Page() {
88
return (
99
<>
1010
<Button
11-
id="nav-button"
11+
id="go-to-404"
1212
onClick={() => {
1313
router.push('/404')
1414
}}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import { createNextDescribe } from 'e2e-utils'
2+
import { check } from 'next-test-utils'
3+
4+
createNextDescribe(
5+
'app dir css',
6+
{
7+
files: __dirname,
8+
skipDeployment: true,
9+
dependencies: {
10+
sass: 'latest',
11+
},
12+
},
13+
({ next }) => {
14+
it('should load css while navigation between not-found and page', async () => {
15+
const browser = await next.browser('/')
16+
await check(
17+
async () =>
18+
await browser.eval(
19+
`window.getComputedStyle(document.querySelector('#go-to-404')).backgroundColor`
20+
),
21+
'rgb(0, 128, 0)'
22+
)
23+
await browser.elementByCss('#go-to-404').click()
24+
await browser.waitForElementByCss('#go-to-index')
25+
await check(
26+
async () =>
27+
await browser.eval(
28+
`window.getComputedStyle(document.querySelector('#go-to-index')).backgroundColor`
29+
),
30+
'rgb(0, 128, 0)'
31+
)
32+
await browser.elementByCss('#go-to-index').click()
33+
await browser.waitForElementByCss('#go-to-404')
34+
await check(
35+
async () =>
36+
await browser.eval(
37+
`window.getComputedStyle(document.querySelector('#go-to-404')).backgroundColor`
38+
),
39+
'rgb(0, 128, 0)'
40+
)
41+
})
42+
}
43+
)

0 commit comments

Comments
 (0)