Test if there are two draw:image in the generated document
This commit is contained in:
parent
b0fe1d8987
commit
c15ef66e77
@ -7,7 +7,7 @@ import {parseXML, Node} from '../../DOMUtils.js'
|
|||||||
* @param {ODTFile} odtFile
|
* @param {ODTFile} odtFile
|
||||||
* @returns {Promise<Document>}
|
* @returns {Promise<Document>}
|
||||||
*/
|
*/
|
||||||
async function getContentDocument(odtFile) {
|
export async function getContentDocument(odtFile) {
|
||||||
const reader = new ZipReader(new Uint8ArrayReader(new Uint8Array(odtFile)));
|
const reader = new ZipReader(new Uint8ArrayReader(new Uint8Array(odtFile)));
|
||||||
|
|
||||||
const entries = await reader.getEntries();
|
const entries = await reader.getEntries();
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import {getOdtTemplate} from '../../scripts/odf/odtTemplate-forNode.js'
|
|||||||
|
|
||||||
import {fillOdtTemplate, getOdtTextContent} from '../../exports.js'
|
import {fillOdtTemplate, getOdtTextContent} from '../../exports.js'
|
||||||
import { listZipEntries } from '../helpers/zip-analysis.js';
|
import { listZipEntries } from '../helpers/zip-analysis.js';
|
||||||
|
import { getContentDocument } from '../../scripts/odf/odt/getOdtTextContent.js';
|
||||||
|
|
||||||
|
|
||||||
test.skip('template filling preserves images', async t => {
|
test.skip('template filling preserves images', async t => {
|
||||||
@ -75,6 +76,9 @@ test('insert 2 images', async t => {
|
|||||||
`Two pictures in 'Pictures/' folder are expected`
|
`Two pictures in 'Pictures/' folder are expected`
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const odtContentDocument = await getContentDocument(odtResult)
|
||||||
|
|
||||||
|
const drawImageElements = odtContentDocument.getElementsByTagName('draw:image')
|
||||||
|
t.is(drawImageElements.length, 2, 'Two draw:image elements should be in the generated document.')
|
||||||
|
|
||||||
t.fail('Two images should be in the content.xml file')
|
|
||||||
})
|
})
|
||||||
Loading…
x
Reference in New Issue
Block a user