Skip to content
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.

Commit

Permalink
test: add test for head properly set within nuxt.config
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Nov 25, 2020
1 parent cbc3764 commit f5f876b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/e2e/meta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ test('Shows correct title on server-loaded page', async t => {

await t.click(Selector('button').withText('Set'))
await t.expect(Selector('meta').getAttribute('content')).eql('new message')
await t.expect(Selector('noscript').textContent).eql('Test')

await t.click(Selector('a').withText('back'))
await t.expect(Selector('title').innerText).eql('My fixture - fixture')
Expand All @@ -36,4 +37,5 @@ test('Shows correct title on client-loaded page', async t => {

await t.click(Selector('button').withText('Set'))
await t.expect(Selector('meta').getAttribute('content')).eql('new message')
await t.expect(Selector('noscript').textContent).eql('Test')
})
5 changes: 5 additions & 0 deletions test/fixture/nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ module.exports = {
],
head: {
titleTemplate: title => `${title} - fixture`,
noscript: [
{
innerHTML: 'Test',
},
],
link: isTesting
? []
: [
Expand Down

0 comments on commit f5f876b

Please sign in to comment.