mirror of
https://github.com/tenrok/BBob.git
synced 2026-05-30 15:24:05 +03:00
f6dfc7dcf4
* feat(vue3): add vue3 package * fix(vue3): add package to lerna config
39 lines
948 B
JavaScript
39 lines
948 B
JavaScript
import { render } from "../src";
|
|
|
|
describe('@bbob/vue3 render', () => {
|
|
|
|
const createElement = (tagName, props, children) => {
|
|
return { tagName, props, children }
|
|
}
|
|
|
|
test('render simple b tag', () => {
|
|
const html = render(createElement, '[b]bolded text[/b]');
|
|
|
|
expect(html).toStrictEqual([
|
|
{
|
|
"children": ["bolded", " ", "text"],
|
|
"props": { "class": undefined, "key": 0, "style": undefined },
|
|
"tagName": "b"
|
|
}
|
|
])
|
|
})
|
|
test('render self closed b tag', () => {
|
|
const html = render(createElement, '[b][/b]');
|
|
|
|
expect(html).toStrictEqual([
|
|
{
|
|
"children": null,
|
|
"props": { "class": undefined, "key": 0, "style": undefined },
|
|
"tagName": "b"
|
|
}
|
|
])
|
|
})
|
|
test('render simple text nodes', () => {
|
|
const html = render(createElement, 'some example words');
|
|
|
|
expect(html).toStrictEqual([
|
|
"some", " ", "example", " ", "words"
|
|
])
|
|
})
|
|
})
|