1
1
mirror of https://github.com/c8r/x0.git synced 2024-07-14 16:50:34 +03:00
x0/test/template.js
2018-05-19 17:20:25 -04:00

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)
})