mirror of
https://github.com/tenrok/BBob.git
synced 2026-06-17 19:21:20 +03:00
fix(html): add more tests
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
const render = require('../lib/index');
|
||||
const parse = require('@bbob/parser');
|
||||
|
||||
const process = input => render(parse(input));
|
||||
const process = (input, params) => render(parse(input), params);
|
||||
|
||||
describe('@bbob/html', () => {
|
||||
test('render bbcode tag with single param as html tag', () => {
|
||||
@@ -24,4 +24,20 @@ describe('@bbob/html', () => {
|
||||
|
||||
expect(process(input)).toBe(result);
|
||||
});
|
||||
|
||||
test('strip tags', () => {
|
||||
const input = '[url]https://ru.wikipedia.org[/url]';
|
||||
const result = 'https://ru.wikipedia.org';
|
||||
|
||||
expect(process(input, { stripTags: true })).toBe(result);
|
||||
});
|
||||
|
||||
test('array of nodes', () => {
|
||||
const input = [
|
||||
'https://ru.wikipedia.org'
|
||||
];
|
||||
const result = 'https://ru.wikipedia.org';
|
||||
|
||||
expect(render(input)).toBe(result);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user