Unverified Commit 4c6ec18d authored by HaNdTriX's avatar HaNdTriX Committed by GitHub

Remove dublicate className from head (followup) (#5027)

* Add test of default head.

* Remove duplicate next-head (followup #5026)
parent 267cff3b
......@@ -29,7 +29,7 @@ function reduceComponents (components) {
return a.concat(b)
}, [])
.reverse()
.concat(defaultHead())
.concat(defaultHead(''))
.filter(Boolean)
.filter(unique())
.reverse()
......
import React from 'react'
import Head from 'next/head'
export default () => <div>
<Head />
<h1>next-head, but only once.</h1>
</div>
......@@ -28,6 +28,7 @@ describe('Basic Features', () => {
// pre-build all pages at the start
await Promise.all([
renderViaHTTP(context.appPort, '/async-props'),
renderViaHTTP(context.appPort, '/default-head'),
renderViaHTTP(context.appPort, '/empty-get-initial-props'),
renderViaHTTP(context.appPort, '/error'),
renderViaHTTP(context.appPort, '/finish-response'),
......
......@@ -26,6 +26,13 @@ export default function ({ app }, suiteName, render, fetch) {
expect(answer.text()).toBe('The answer is 42')
})
// default-head contains an empty <Head />.
test('header renders default charset', async () => {
const html = await (render('/default-head'))
expect(html.includes('<meta charSet="utf-8" class="next-head"/>')).toBeTruthy()
expect(html.includes('next-head, but only once.')).toBeTruthy()
})
test('header helper renders header information', async () => {
const html = await (render('/head'))
expect(html.includes('<meta charSet="iso-8859-5" class="next-head"/>')).toBeTruthy()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment