aboutsummaryrefslogtreecommitdiff
path: root/src/test/java
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2016-11-19 20:06:16 +0000
committerMichael Williamson <mike@zwobble.org>2016-11-19 20:06:16 +0000
commitcf51080fc233196a5bf6c40c06e1a4ec32e85d5b (patch)
tree805dfd414e64a60339eab5ecaf1fb69f737a9700 /src/test/java
parent272a92ca4f43b22c8bccd0a8d591feeab6bfa8fb (diff)
Add tests for combining custom and embedded style maps
Diffstat (limited to 'src/test/java')
-rw-r--r--src/test/java/org/zwobble/mammoth/tests/MammothTests.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/test/java/org/zwobble/mammoth/tests/MammothTests.java b/src/test/java/org/zwobble/mammoth/tests/MammothTests.java
index 8454a3d..bafd857 100644
--- a/src/test/java/org/zwobble/mammoth/tests/MammothTests.java
+++ b/src/test/java/org/zwobble/mammoth/tests/MammothTests.java
@@ -236,6 +236,22 @@ public class MammothTests {
}
@Test
+ public void explicitStyleMapTakesPrecendenceOverEmbeddedStyleMap() throws IOException {
+ assertThat(
+ convertToHtml("embedded-style-map.docx", options -> options.addStyleMap("p => p")),
+ isSuccess("<p>Walking on imported air</p>")
+ );
+ }
+
+ @Test
+ public void explicitStyleMapIsCombinedWithEmbeddedStyleMap() throws IOException {
+ assertThat(
+ convertToHtml("embedded-style-map.docx", options -> options.addStyleMap("r => strong")),
+ isSuccess("<h1><strong>Walking on imported air</strong></h1>")
+ );
+ }
+
+ @Test
public void embeddedStyleMapCanBeWrittenAndThenRead() throws IOException {
InMemoryArchive archive = InMemoryArchive.fromStream(new FileInputStream(TestData.file("single-paragraph.docx")));
EmbeddedStyleMap.embedStyleMap(archive, "p => h1");