diff --git a/test/e2e/app-dir/head.test.ts b/test/e2e/app-dir/head.test.ts index b39f4f8493d80a6..1b70def95721828 100644 --- a/test/e2e/app-dir/head.test.ts +++ b/test/e2e/app-dir/head.test.ts @@ -42,16 +42,18 @@ describe('app dir head', () => { ).toBeTruthy() }) - it('should not use head from layout when on page', async () => { + it('should use correct head for /blog', async () => { const html = await renderViaHTTP(next.url, '/blog') const $ = cheerio.load(html) const headTags = $('head').children().toArray() + expect(headTags.find((el) => el.attribs.src === '/hello3.js')).toBeFalsy() expect( - headTags.find((el) => el.attribs.src === '/hello3.js') + headTags.find((el) => el.attribs.src === '/hello1.js') + ).toBeTruthy() + expect( + headTags.find((el) => el.attribs.src === '/hello2.js') ).toBeTruthy() - expect(headTags.find((el) => el.attribs.src === '/hello1.js')).toBeFalsy() - expect(headTags.find((el) => el.attribs.src === '/hello2.js')).toBeFalsy() expect( headTags.find((el) => el.attribs.src === '/another.js') ).toBeTruthy() diff --git a/test/e2e/app-dir/head/app/blog/page.js b/test/e2e/app-dir/head/app/blog/page.js index 5ad612b87daf781..08e79e0e1f464bf 100644 --- a/test/e2e/app-dir/head/app/blog/page.js +++ b/test/e2e/app-dir/head/app/blog/page.js @@ -11,12 +11,3 @@ export default function Page() { ) } - -export async function Head() { - return ( - <> -