mirror of
https://github.com/tenrok/BBob.git
synced 2026-05-15 11:59:37 +03:00
f1f9eb39da
* fix(react): render words and spaces as single node in react * chore: create metal-toys-heal.md
28 lines
675 B
JavaScript
28 lines
675 B
JavaScript
import React from 'react'
|
|
import { render } from "../src";
|
|
|
|
describe('@bbob/react render', () => {
|
|
test('render simple b tag', () => {
|
|
const html = render('[b]boldedtext[/b]');
|
|
|
|
expect(html[0].type).toStrictEqual('b')
|
|
})
|
|
test('render self closed b tag', () => {
|
|
const html = render('[b][/b]');
|
|
|
|
expect(html[0].type).toBe('b')
|
|
})
|
|
test('render simple text nodes', () => {
|
|
const html = render('some example words');
|
|
|
|
expect(html[0]).toStrictEqual("some example words")
|
|
})
|
|
test('render simple text nodes with line break', () => {
|
|
const html = render(`some
|
|
example
|
|
words`);
|
|
|
|
expect(html[0]).toStrictEqual("some")
|
|
})
|
|
})
|