diff --git a/tests/fill-odt-template/formatting.js b/tests/fill-odt-template/formatting.js index 29b7a50..cf05508 100644 --- a/tests/fill-odt-template/formatting.js +++ b/tests/fill-odt-template/formatting.js @@ -83,4 +83,32 @@ Les nombres : {#each nombres as n}{n} {/each} !! Les nombres : 3 5 8 13  !! `) -}); \ No newline at end of file +}); + + +// +test('template filling - {/each} and text after partially formatted', async t => { + const templatePath = join(import.meta.dirname, '../fixtures/formatting-liste-nombres-each-end-and-after-formatted.odt') + const templateContent = `Liste de nombres + +Les nombres : {#each nombres as n}{n} {/each} !! +` + + const data = { + nombres : [5,8, 13, 21] + } + + const odtTemplate = await getOdtTemplate(templatePath) + + const templateTextContent = await getOdtTextContent(odtTemplate) + t.deepEqual(templateTextContent, templateContent, 'reconnaissance du template') + + const odtResult = await fillOdtTemplate(odtTemplate, data) + + const odtResultTextContent = await getOdtTextContent(odtResult) + t.deepEqual(odtResultTextContent, `Liste de nombres + +Les nombres : 5 8 13 21  !! +`) + +}); diff --git a/tests/fixtures/formatting-liste-nombres-each-end-and-after-formatted.odt b/tests/fixtures/formatting-liste-nombres-each-end-and-after-formatted.odt new file mode 100644 index 0000000..43a5e9b Binary files /dev/null and b/tests/fixtures/formatting-liste-nombres-each-end-and-after-formatted.odt differ