3
0
mirror of https://github.com/larvit/adf-codec.git synced 2026-11-18 06:05:43 +01:00

Test unknown mixed content and a mention with nothing to show

This commit is contained in:
2026-11-14 15:35:02 +01:00
committed by Lillem4n
parent 1aa443f92a
commit 21391d2a86
+5
View File
@@ -151,6 +151,11 @@ test('writes a node of an unknown type as the text it holds, its children a blan
assert.equal(plain(adfToPlainText(document(unknown, { text: 'loose', type: 'unknownText' }, paragraph({ content: [text('in'), text(' line')], type: 'unknownInline' })))), 'one\n\ntwo three\n\nloose\n\nin line')
})
test('writes a node of an unknown type holding text and blocks as blocks, and a mention with nothing to show as nothing', () => {
assert.equal(plain(adfToPlainText(document({ content: [text('a'), line('b')], type: 'unknownContainer' }))), 'a\n\nb')
assert.equal(plain(adfToPlainText(document(paragraph(text('a'), { type: 'mention' }, text('b'))))), 'ab')
})
test('writes a code block\'s lines and a list item\'s continuation lines under their indent, never a blank line with spaces', () => {
const code: AdfNode = { content: [text('a\n\nb')], type: 'codeBlock' }
assert.equal(plain(adfToPlainText(document(bullets(item(code))))), '• a\n\n b')