connector-wordpress/source/connector-mobilizon/front/html-creator-test.js

16 lines
386 B
JavaScript
Raw Normal View History

import test from 'ava'
import { JSDOM } from 'jsdom'
2021-01-08 14:08:40 +01:00
import * as HtmlCreator from './html-creator'
2021-01-08 14:08:40 +01:00
test.beforeEach(() => {
global.document = new JSDOM().window.document
})
test('createAnchorElement() usual parameters', t => {
const a = HtmlCreator.createAnchorElement({ text: 'a', url: 'b' })
t.is(a.tagName, 'A')
t.is(a.innerHTML, 'a')
t.is(a.getAttribute('href'), 'b')
})