Skip to content

Commit

Permalink
Added two more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
asegal-hs committed Nov 7, 2023
1 parent 0e4692a commit be44efa
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/test/java/com/hubspot/jinjava/lib/filter/RenderFilterTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,19 @@ public void itDoesNotRenderObjectOverLimit() {

assertThat(filter.filter(stringToRender, interpreter, "4")).isEqualTo("");
}

@Test
public void itRendersPartialObjectOverLimit() {
String stringToRender = "Hello{% if null %}Hello{% else %}world{% endif %}";

assertThat(filter.filter(stringToRender, interpreter, "7")).isEqualTo("Hello");
}

@Test
public void itCountsHtmlTags() {
String stringToRender = "<p>Hello</p>{% if null %}Hello{% else %}world{% endif %}";

assertThat(filter.filter(stringToRender, interpreter, "15"))
.isEqualTo("<p>Hello</p>");
}
}

0 comments on commit be44efa

Please sign in to comment.