1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-24 10:27:10 +02:00
joplin/packages/lib/services/interop/utils.test.ts

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);
});
});