Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
docxtemplater-image-module
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
npm
docxtemplater-image-module
Commits
86db9d6e
Commit
86db9d6e
authored
Apr 05, 2015
by
Edgar Hipp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added test to work even if they are no images with qrcode
parent
fa64245c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
0 deletions
+23
-0
coffee/test.coffee
+23
-0
examples/noImage.docx
+0
-0
No files found.
coffee/test.coffee
View file @
86db9d6e
...
...
@@ -7,6 +7,7 @@ fileNames=[
'imageLoopExample.docx'
,
'imageInlineExample.docx'
,
'qrExample.docx'
,
'noImage.docx'
,
'qrExample2.docx'
,
]
...
...
@@ -194,6 +195,28 @@ describe 'qrcode replacing',->
expect
(
images
[
2
].
asText
().
length
).
to
.
equal
(
17417
)
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',()->
# name='imageInlineExample.docx'
...
...
examples/noImage.docx
0 → 100644
View file @
86db9d6e
File added
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment