aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2014-04-22 11:05:42 +0100
committerMichael Williamson <mike@zwobble.org>2014-04-22 11:05:42 +0100
commit57cc8dff2e5723b8468c2f1fa1020ac2a9144022 (patch)
treed04cc33addc704c07696aa44a4503c5e5388fad5 /tests
parentbc8e8b44a05041bc656e83a87d857ec58ba0b4fe (diff)
Rename styleName to the more accurate styleId
Diffstat (limited to 'tests')
-rw-r--r--tests/document-matchers.tests.js4
-rw-r--r--tests/document-to-html.tests.js8
-rw-r--r--tests/docx/document-xml-reader.tests.js8
-rw-r--r--tests/mammoth.tests.js2
4 files changed, 11 insertions, 11 deletions
diff --git a/tests/document-matchers.tests.js b/tests/document-matchers.tests.js
index 6d77926..581746c 100644
--- a/tests/document-matchers.tests.js
+++ b/tests/document-matchers.tests.js
@@ -40,6 +40,6 @@ describe("document-matchers", function() {
});
});
-function paragraphWithStyle(styleName) {
- return new Paragraph([], {styleName: styleName});
+function paragraphWithStyle(styleId) {
+ return new Paragraph([], {styleId: styleId});
}
diff --git a/tests/document-to-html.tests.js b/tests/document-to-html.tests.js
index 35f4424..b69d0fb 100644
--- a/tests/document-to-html.tests.js
+++ b/tests/document-to-html.tests.js
@@ -156,7 +156,7 @@ describe('DocumentConverter', function() {
});
test('run styles are converted to HTML if mapping exists', function() {
- var run = runOfText("Hello.", {styleName: "Emphasis"});
+ var run = runOfText("Hello.", {styleId: "Emphasis"});
var converter = new DocumentConverter({
styleMap: [
{
@@ -171,7 +171,7 @@ describe('DocumentConverter', function() {
});
test('warning is emitted if run style is unrecognised', function() {
- var run = runOfText("Hello.", {styleName: "Emphasis"});
+ var run = runOfText("Hello.", {styleId: "Emphasis"});
var converter = new DocumentConverter();
return converter.convertToHtml(run).then(function(result) {
assert.deepEqual(result.messages, [results.warning("Unrecognised run style: Emphasis")]);
@@ -264,10 +264,10 @@ describe('DocumentConverter', function() {
});
});
-function paragraphOfText(text, styleName) {
+function paragraphOfText(text, styleId) {
var run = runOfText(text);
return new documents.Paragraph([run], {
- styleName: styleName
+ styleId: styleId
});
}
diff --git a/tests/docx/document-xml-reader.tests.js b/tests/docx/document-xml-reader.tests.js
index 7cdbefc..714134e 100644
--- a/tests/docx/document-xml-reader.tests.js
+++ b/tests/docx/document-xml-reader.tests.js
@@ -30,7 +30,7 @@ describe("readXmlElement: ", function() {
test("paragraph has no style if it has no properties", function() {
var paragraphXml = new XmlElement("w:p", {}, []);
var paragraph = readXmlElementValue(paragraphXml);
- assert.deepEqual(paragraph.styleName, null);
+ assert.deepEqual(paragraph.styleId, null);
});
test("paragraph has style name read from paragraph properties if present", function() {
@@ -38,7 +38,7 @@ describe("readXmlElement: ", function() {
var propertiesXml = new XmlElement("w:pPr", {}, [styleXml]);
var paragraphXml = new XmlElement("w:p", {}, [propertiesXml]);
var paragraph = readXmlElementValue(paragraphXml);
- assert.deepEqual(paragraph.styleName, "Heading1");
+ assert.deepEqual(paragraph.styleId, "Heading1");
});
test("paragraph has justification read from paragraph properties if present", function() {
@@ -72,14 +72,14 @@ describe("readXmlElement: ", function() {
test("run has no style if it has no properties", function() {
var runXml = runWithProperties([]);
var run = readXmlElementValue(runXml);
- assert.deepEqual(run.styleName, null);
+ assert.deepEqual(run.styleId, null);
});
test("run has style name read from run properties if present", function() {
var runStyleXml = new XmlElement("w:rStyle", {"w:val": "Emphasis"});
var runXml = runWithProperties([runStyleXml]);
var run = readXmlElementValue(runXml);
- assert.deepEqual(run.styleName, "Emphasis");
+ assert.deepEqual(run.styleId, "Emphasis");
});
test("isBold is false if bold element is not present", function() {
diff --git a/tests/mammoth.tests.js b/tests/mammoth.tests.js
index 0f9241e..cc08565 100644
--- a/tests/mammoth.tests.js
+++ b/tests/mammoth.tests.js
@@ -65,7 +65,7 @@ describe('mammoth', function() {
});
var options = {
transformDocument: function(document) {
- document.children[0].styleName = "Heading1";
+ document.children[0].styleId = "Heading1";
return document;
}
};