failing test
This commit is contained in:
parent
6cf15c7d04
commit
9275e5777a
@ -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 => {
|
test('template filling of a table', async t => {
|
||||||
const templatePath = join(import.meta.dirname, './fixtures/tableau-simple.odt')
|
const templatePath = join(import.meta.dirname, './fixtures/tableau-simple.odt')
|
||||||
|
|||||||
BIN
tests/fixtures/liste-nombres.odt
vendored
Normal file
BIN
tests/fixtures/liste-nombres.odt
vendored
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user