Test with {/each} and text after partially formatted passing
This commit is contained in:
parent
b859f62412
commit
35a9c4785a
@ -83,4 +83,32 @@ Les nombres : {#each nombres as n}{n} {/each} !!
|
|||||||
Les nombres : 3 5 8 13 !!
|
Les nombres : 3 5 8 13 !!
|
||||||
`)
|
`)
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
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 !!
|
||||||
|
`)
|
||||||
|
|
||||||
|
});
|
||||||
|
|||||||
BIN
tests/fixtures/formatting-liste-nombres-each-end-and-after-formatted.odt
vendored
Normal file
BIN
tests/fixtures/formatting-liste-nombres-each-end-and-after-formatted.odt
vendored
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user