Commit 86db9d6e by Edgar Hipp

added test to work even if they are no images with qrcode

parent fa64245c
...@@ -7,6 +7,7 @@ fileNames=[ ...@@ -7,6 +7,7 @@ fileNames=[
'imageLoopExample.docx', 'imageLoopExample.docx',
'imageInlineExample.docx', 'imageInlineExample.docx',
'qrExample.docx', 'qrExample.docx',
'noImage.docx',
'qrExample2.docx', 'qrExample2.docx',
] ]
...@@ -194,6 +195,28 @@ describe 'qrcode replacing',-> ...@@ -194,6 +195,28 @@ describe 'qrcode replacing',->
expect(images[2].asText().length).to.equal(17417) expect(images[2].asText().length).to.equal(17417)
expect(images[3].asText().length).to.equal(7177) expect(images[3].asText().length).to.equal(7177)
describe 'should work without images (it should call finished())',()->
d=null
before (done)->
d=new DocxGen()
name='noImage.docx'
imageModule=new ImageModule({qrCode:true})
imageModule.finished=()->
zip=d.getZip()
buffer=zip.generate({type:"nodebuffer"})
fs.writeFile("testNoImage.docx",buffer);
done()
d.attachModule(imageModule)
out=d
.load(docX[name].loadedContent)
.setData()
.render()
it 'should have the same text',->
text = d.getFullText()
expect(text).to.equal("Here is no image")
# it 'should work with inline images',()-> # it 'should work with inline images',()->
# name='imageInlineExample.docx' # name='imageInlineExample.docx'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment