failing test

This commit is contained in:
David Bruant 2025-04-21 21:32:30 +02:00
parent 6cf15c7d04
commit 9275e5777a
2 changed files with 27 additions and 0 deletions

View File

@ -279,6 +279,33 @@ Hiver
});
test('template filling {#each ...}{/each} within a single text node', async t => {
const templatePath = join(import.meta.dirname, './fixtures/liste-nombres.odt')
const templateContent = `Liste de nombres
{#each nombres as n}{n} {/each}
`
const data = {
nombres : [1,1,2,3,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
1 1 2 3 5 8 13 21
`)
});
test('template filling of a table', async t => {
const templatePath = join(import.meta.dirname, './fixtures/tableau-simple.odt')

BIN
tests/fixtures/liste-nombres.odt vendored Normal file

Binary file not shown.