aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/test')
-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");