-
Notifications
You must be signed in to change notification settings - Fork 564
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
59 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
flying-saucer-pdf/src/test/java/org/xhtmlrenderer/pdf/HTMLOutlineTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package org.xhtmlrenderer.pdf; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
import static org.xhtmlrenderer.pdf.HTMLOutline.getOutlineLevelFromTagName; | ||
|
||
class HTMLOutlineTest { | ||
@Test | ||
void getsOutlineLevelFromTagName_header() { | ||
assertThat(getOutlineLevelFromTagName("h1")).isEqualTo("1"); | ||
assertThat(getOutlineLevelFromTagName("H2")).isEqualTo("2"); | ||
assertThat(getOutlineLevelFromTagName("h3")).isEqualTo("3"); | ||
assertThat(getOutlineLevelFromTagName("H6")).isEqualTo("6"); | ||
assertThat(getOutlineLevelFromTagName("h7")).isEqualTo("7"); | ||
assertThat(getOutlineLevelFromTagName("h10")).isEqualTo("10"); | ||
assertThat(getOutlineLevelFromTagName("h16")).isEqualTo("16"); | ||
assertThat(getOutlineLevelFromTagName("h99")).isEqualTo("99"); | ||
} | ||
|
||
@Test | ||
void getsOutlineLevelFromTagName_exclude() { | ||
assertThat(getOutlineLevelFromTagName("blockquote")).isEqualTo("exclude"); | ||
assertThat(getOutlineLevelFromTagName("BLOCKQUOTE")).isEqualTo("exclude"); | ||
assertThat(getOutlineLevelFromTagName("details")).isEqualTo("exclude"); | ||
assertThat(getOutlineLevelFromTagName("fieldset")).isEqualTo("exclude"); | ||
assertThat(getOutlineLevelFromTagName("figure")).isEqualTo("exclude"); | ||
assertThat(getOutlineLevelFromTagName("td")).isEqualTo("exclude"); | ||
assertThat(getOutlineLevelFromTagName("TD")).isEqualTo("exclude"); | ||
} | ||
|
||
@Test | ||
void getsOutlineLevelFromTagName_none() { | ||
assertThat(getOutlineLevelFromTagName("div")).isEqualTo("none"); | ||
assertThat(getOutlineLevelFromTagName("table")).isEqualTo("none"); | ||
assertThat(getOutlineLevelFromTagName("span")).isEqualTo("none"); | ||
assertThat(getOutlineLevelFromTagName("SPAN")).isEqualTo("none"); | ||
} | ||
} |