aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2015-09-12 14:07:07 +0100
committerMichael Williamson <mike@zwobble.org>2015-09-12 14:07:07 +0100
commita0dcb5cbc43ea09e3bf08afcb7620105c8794ec2 (patch)
treeb7f94a15fb1d5656f58ed8fea19444a54540e3f7
parenta4afe3c01c1035f8da490503917c419e1aa2eb5a (diff)
Extract duplicated expectedRelationshipsXml
-rw-r--r--tests/docx/style-map.tests.js18
1 files changed, 6 insertions, 12 deletions
diff --git a/tests/docx/style-map.tests.js b/tests/docx/style-map.tests.js
index 34dab8d..0c8ef23 100644
--- a/tests/docx/style-map.tests.js
+++ b/tests/docx/style-map.tests.js
@@ -30,12 +30,6 @@ describe("style-map", function() {
test('embedded style map is referenced in relationships', function() {
var zip = normalDocx();
- var expectedRelationshipsXml = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>' +
- '<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">' +
- '<Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings" Target="settings.xml"/>' +
- '<Relationship Id="rMammothStyleMap" Type="http://schemas.zwobble.org/mammoth/style-map" Target="/mammoth/style-map"/>' +
- '</Relationships>';
-
return styleMap.writeStyleMap(zip, "p => h1").then(function() {
return zip.read("word/_rels/document.xml.rels", "utf8").then(function(contents) {
assert.equal(contents, expectedRelationshipsXml);
@@ -46,12 +40,6 @@ describe("style-map", function() {
test('re-embedding style map replaces original', function() {
var zip = normalDocx();
- var expectedRelationshipsXml = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>' +
- '<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">' +
- '<Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings" Target="settings.xml"/>' +
- '<Relationship Id="rMammothStyleMap" Type="http://schemas.zwobble.org/mammoth/style-map" Target="/mammoth/style-map"/>' +
- '</Relationships>';
-
return styleMap.writeStyleMap(zip, "p => h1").then(function() {
return styleMap.writeStyleMap(zip, "p => h2");
}).then(function() {
@@ -89,6 +77,12 @@ describe("style-map", function() {
});
+var expectedRelationshipsXml = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>' +
+ '<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">' +
+ '<Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings" Target="settings.xml"/>' +
+ '<Relationship Id="rMammothStyleMap" Type="http://schemas.zwobble.org/mammoth/style-map" Target="/mammoth/style-map"/>' +
+ '</Relationships>';
+
var expectedContentTypesXml = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>' +
'<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">' +
'<Default Extension="png" ContentType="image/png"/>' +