mirror of
https://github.com/laurent22/joplin.git
synced 2025-01-26 18:58:21 +02:00
36 lines
804 B
TypeScript
36 lines
804 B
TypeScript
|
import { RenderedNoteMetadata, parseRenderedNoteMetadata } from './utils';
|
||
|
|
||
|
describe('interop/utils', () => {
|
||
|
|
||
|
test.each<[string, RenderedNoteMetadata]>([
|
||
|
[
|
||
|
'',
|
||
|
{ printTitle: true },
|
||
|
],
|
||
|
[
|
||
|
'<!-- joplin-metadata-print-title = false -->',
|
||
|
{ printTitle: false },
|
||
|
],
|
||
|
[
|
||
|
'<!-- joplin-metadata-print-title = true -->',
|
||
|
{ printTitle: true },
|
||
|
],
|
||
|
[
|
||
|
'<!-- joplin-metadata-print-title = 0 -->',
|
||
|
{ printTitle: false },
|
||
|
],
|
||
|
[
|
||
|
'<!-- joplin-metadata-print-title = 1 -->',
|
||
|
{ printTitle: true },
|
||
|
],
|
||
|
[
|
||
|
'<!-- joplin-metadata-print-title = 0 -->',
|
||
|
{ printTitle: false },
|
||
|
],
|
||
|
])('should parse metadata from the note HTML body', async (bodyHtml, expected) => {
|
||
|
const actual = parseRenderedNoteMetadata(bodyHtml);
|
||
|
expect(actual).toEqual(expected);
|
||
|
});
|
||
|
|
||
|
});
|