Skip to content

Commit be13ce2

Browse files
committed
update test
1 parent 74e23a3 commit be13ce2

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

test/e2e/app-dir/metadata/app/dynamic/[slug]/page.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
async function format({ params, searchParams }) {
2-
const { slug } = params
2+
const { slug } = await params
33
const { q } = await searchParams
44
return `params - ${slug}${q ? ` query - ${q}` : ''}`
55
}

test/e2e/app-dir/metadata/metadata.test.ts

+6-8
Original file line numberDiff line numberDiff line change
@@ -549,8 +549,8 @@ describe('app dir - metadata', () => {
549549
it('should render icon and apple touch icon meta if their images are specified', async () => {
550550
const $ = await next.render$('/icons/static/nested')
551551

552-
const $icon = $('head > link[rel="icon"][type!="image/x-icon"]')
553-
const $appleIcon = $('head > link[rel="apple-touch-icon"]')
552+
const $icon = $('link[rel="icon"][type!="image/x-icon"]')
553+
const $appleIcon = $('link[rel="apple-touch-icon"]')
554554

555555
expect($icon.attr('href')).toMatch(/\/icons\/static\/nested\/icon1/)
556556
expect($icon.attr('sizes')).toBe('32x32')
@@ -565,19 +565,17 @@ describe('app dir - metadata', () => {
565565
it('should not render if image file is not specified', async () => {
566566
const $ = await next.render$('/icons/static')
567567

568-
const $icon = $('head > link[rel="icon"][type!="image/x-icon"]')
568+
const $icon = $('link[rel="icon"][type!="image/x-icon"]')
569569

570570
expect($icon.attr('href')).toMatch(/\/icons\/static\/icon/)
571571
expect($icon.attr('sizes')).toBe('114x114')
572572

573573
// No apple icon if it's not provided
574-
const $appleIcon = $('head > link[rel="apple-touch-icon"]')
574+
const $appleIcon = $('link[rel="apple-touch-icon"]')
575575
expect($appleIcon.length).toBe(0)
576576

577577
const $dynamic = await next.render$('/icons/static/dynamic-routes/123')
578-
const $dynamicIcon = $dynamic(
579-
'head > link[rel="icon"][type!="image/x-icon"]'
580-
)
578+
const $dynamicIcon = $dynamic('link[rel="icon"][type!="image/x-icon"]')
581579
const dynamicIconHref = $dynamicIcon.attr('href')
582580
expect(dynamicIconHref).toMatch(
583581
/\/icons\/static\/dynamic-routes\/123\/icon/
@@ -845,7 +843,7 @@ describe('app dir - metadata', () => {
845843

846844
await check(async () => {
847845
const $ = await next.render$('/icons/static')
848-
const $icon = $('head > link[rel="icon"][type!="image/x-icon"]')
846+
const $icon = $('link[rel="icon"][type!="image/x-icon"]')
849847
return $icon.attr('href')
850848
}, /\/icons\/static\/icon2/)
851849

0 commit comments

Comments
 (0)