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
2b8c0ce5
Commit
2b8c0ce5
authored
Mar 21, 2017
by
Edgar HIPP
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix eslint
parent
3422a281
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
es6/test.js
+5
-5
No files found.
es6/test.js
View file @
2b8c0ce5
...
@@ -8,7 +8,7 @@ const JSZip = require("jszip");
...
@@ -8,7 +8,7 @@ const JSZip = require("jszip");
const
ImageModule
=
require
(
"./index.js"
);
const
ImageModule
=
require
(
"./index.js"
);
const
testutils
=
require
(
"docxtemplater/js/tests/utils"
);
const
testutils
=
require
(
"docxtemplater/js/tests/utils"
);
const
shouldBeSame
=
testutils
.
shouldBeSame
;
const
shouldBeSame
=
testutils
.
shouldBeSame
;
const
sizeOf
=
require
(
'image-size'
);
const
sizeOf
=
require
(
"image-size"
);
const
fileNames
=
[
const
fileNames
=
[
"imageExample.docx"
,
"imageExample.docx"
,
...
@@ -28,7 +28,7 @@ const fileNames = [
...
@@ -28,7 +28,7 @@ const fileNames = [
"expectedTagImage.pptx"
,
"expectedTagImage.pptx"
,
"tagImageCentered.pptx"
,
"tagImageCentered.pptx"
,
"expectedTagImageCentered.pptx"
,
"expectedTagImageCentered.pptx"
,
"expectedInlineResize.docx"
"expectedInlineResize.docx"
,
];
];
beforeEach
(
function
()
{
beforeEach
(
function
()
{
...
@@ -43,7 +43,7 @@ beforeEach(function () {
...
@@ -43,7 +43,7 @@ beforeEach(function () {
};
};
this
.
loadAndRender
=
function
()
{
this
.
loadAndRender
=
function
()
{
const
file
=
testutils
.
createDoc
(
this
.
name
)
const
file
=
testutils
.
createDoc
(
this
.
name
)
;
this
.
doc
=
new
Docxtemplater
();
this
.
doc
=
new
Docxtemplater
();
const
inputZip
=
new
JSZip
(
file
.
loadedContent
);
const
inputZip
=
new
JSZip
(
file
.
loadedContent
);
this
.
doc
.
loadZip
(
inputZip
).
setData
(
this
.
data
);
this
.
doc
.
loadZip
(
inputZip
).
setData
(
this
.
data
);
...
@@ -125,10 +125,10 @@ function testStart() {
...
@@ -125,10 +125,10 @@ function testStart() {
it
(
"should work with auto resize"
,
function
()
{
it
(
"should work with auto resize"
,
function
()
{
this
.
name
=
"imageInlineExample.docx"
;
this
.
name
=
"imageInlineExample.docx"
;
this
.
expectedName
=
"expectedInlineResize.docx"
;
this
.
expectedName
=
"expectedInlineResize.docx"
;
this
.
opts
.
getSize
=
function
(
img
,
tagValue
,
tagName
)
{
this
.
opts
.
getSize
=
function
(
img
)
{
const
sizeObj
=
sizeOf
(
img
);
const
sizeObj
=
sizeOf
(
img
);
return
[
sizeObj
.
width
,
sizeObj
.
height
];
return
[
sizeObj
.
width
,
sizeObj
.
height
];
}
}
;
this
.
data
=
{
firefox
:
"examples/image.png"
};
this
.
data
=
{
firefox
:
"examples/image.png"
};
this
.
loadAndRender
();
this
.
loadAndRender
();
});
});
...
...
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