From 60f95c241dc56bb5ec3149d539481b8897b40368 Mon Sep 17 00:00:00 2001 From: JJ Kasper Date: Tue, 25 Oct 2022 00:14:07 -0700 Subject: [PATCH] update test --- test/e2e/app-dir/head.test.ts | 10 ++++++---- test/e2e/app-dir/head/app/blog/page.js | 9 --------- 2 files changed, 6 insertions(+), 13 deletions(-) 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 ( - <> -