2020-07-05 13:30:25 +02:00
|
|
|
const { test } = require('tap')
|
2020-07-18 22:44:17 +02:00
|
|
|
const { HtmlValidate } = require('html-validate')
|
2020-07-05 13:30:25 +02:00
|
|
|
|
2020-07-05 14:19:26 +02:00
|
|
|
const { render } = require('..')
|
2020-08-29 22:40:18 +02:00
|
|
|
const resume = require('resume-schema/sample.resume.json')
|
2020-07-05 13:30:25 +02:00
|
|
|
|
|
|
|
test('renders a resume', t => {
|
2020-07-05 14:19:26 +02:00
|
|
|
t.matchSnapshot(render(resume))
|
|
|
|
t.end()
|
2020-07-05 13:30:25 +02:00
|
|
|
})
|
2020-07-18 22:44:17 +02:00
|
|
|
|
|
|
|
test('renders valid HTML', t => {
|
|
|
|
const htmlvalidate = new HtmlValidate({
|
2021-02-14 15:18:58 +01:00
|
|
|
extends: ['html-validate:recommended'],
|
2021-03-03 19:42:34 +01:00
|
|
|
rules: { 'svg-focusable': 'off' },
|
2020-07-18 22:44:17 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
const {
|
|
|
|
results: [{ messages } = {}],
|
|
|
|
} = htmlvalidate.validateString(render(resume))
|
|
|
|
|
|
|
|
t.is(messages, undefined)
|
|
|
|
t.end()
|
|
|
|
})
|