mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-21 09:38:01 +02:00
33 lines
478 B
TypeScript
33 lines
478 B
TypeScript
|
import htmlUtils from './htmlUtils';
|
||
|
|
||
|
describe('htmlUtils', () => {
|
||
|
|
||
|
test('should strip off HTML', () => {
|
||
|
const testCases = [
|
||
|
[
|
||
|
'',
|
||
|
'',
|
||
|
],
|
||
|
[
|
||
|
'<b>test</b>',
|
||
|
'test',
|
||
|
],
|
||
|
[
|
||
|
'Joplin®',
|
||
|
'Joplin®',
|
||
|
],
|
||
|
[
|
||
|
'<b>test</b>',
|
||
|
'<b>test</b>',
|
||
|
],
|
||
|
];
|
||
|
|
||
|
for (const t of testCases) {
|
||
|
const [input, expected] = t;
|
||
|
const actual = htmlUtils.stripHtml(input);
|
||
|
expect(actual).toBe(expected);
|
||
|
}
|
||
|
});
|
||
|
|
||
|
});
|