mirror of
https://github.com/c8r/x0.git
synced 2024-10-26 23:21:46 +03:00
36 lines
813 B
JavaScript
36 lines
813 B
JavaScript
import test from 'ava'
|
|
import template from '../lib/template'
|
|
|
|
test('template snapshot', t => {
|
|
const html = template({
|
|
title: 'Test',
|
|
html: 'hello',
|
|
css: '<style>body{color:tomato}</style>',
|
|
scripts: '<script>console.log("beep")</script>',
|
|
meta: [
|
|
{ name: 'twitter:card', content: 'summary' }
|
|
],
|
|
links: [
|
|
{ rel: 'stylesheet', content: 'hello.css' }
|
|
]
|
|
})
|
|
t.snapshot(html)
|
|
})
|
|
|
|
test('template static snapshot', t => {
|
|
const html = template({
|
|
title: 'Test',
|
|
html: 'hello',
|
|
css: '<style>body{color:tomato}</style>',
|
|
static: true,
|
|
scripts: '<script>console.log("beep")</script>',
|
|
meta: [
|
|
{ name: 'twitter:card', content: 'summary' }
|
|
],
|
|
links: [
|
|
{ rel: 'stylesheet', content: 'hello.css' }
|
|
]
|
|
})
|
|
t.snapshot(html)
|
|
})
|