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

16 lines
370 B
JavaScript
Raw Normal View History

import test from 'ava'
2022-06-03 23:48:19 +02:00
import browserEnv from 'browser-env'
2021-01-08 14:08:40 +01:00
import { createAnchorElement } from './html-creator.js'
2021-05-03 21:39:23 +02:00
2021-01-08 14:08:40 +01:00
test.beforeEach(() => {
2022-06-03 23:48:19 +02:00
browserEnv()
2021-01-08 14:08:40 +01:00
})
2021-12-09 19:46:19 +01:00
test('#createAnchorElement usual parameters', (t) => {
2021-05-03 21:39:23 +02:00
const a = createAnchorElement({ document, text: 'a', url: 'b' })
2021-01-08 14:08:40 +01:00
t.is(a.tagName, 'A')
t.is(a.innerHTML, 'a')
2021-04-05 17:53:47 +02:00
t.is(a.getAttribute('href'), 'b')
2021-01-08 14:08:40 +01:00
})