Skip to content

Commit f2dc050

Browse files
committed
Update tests for overflowing of GridContainerRenderer to the next page
DEVSIX-8340
1 parent 43077c4 commit f2dc050

File tree

38 files changed

+722
-10
lines changed

38 files changed

+722
-10
lines changed

src/test/java/com/itextpdf/html2pdf/css/grid/GridAreaTest.java

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,43 @@ public void templateAreasSwitchedPlacesTest() throws IOException, InterruptedExc
7676
runTest("grid-area-switched-places");
7777
}
7878

79+
@Test
80+
// TODO DEVSIX-8387
81+
public void differentRowSpanTest() throws IOException, InterruptedException {
82+
runTest("differentRowSpanTest");
83+
}
84+
85+
@Test
86+
public void borderBoxTest() throws IOException, InterruptedException {
87+
runTest("borderBoxTest");
88+
}
89+
90+
@Test
91+
public void differentRowSpanOnSplitTest() throws IOException, InterruptedException {
92+
runTest("differentRowSpanOnSplitTest");
93+
}
94+
95+
@Test
96+
// TODO DEVSIX-8387
97+
public void differentRowSpanOnSplitTest2() throws IOException, InterruptedException {
98+
runTest("differentRowSpanOnSplitTest2");
99+
}
100+
101+
@Test
102+
public void differentRowSpanWithGaps50OnSplitTest() throws IOException, InterruptedException {
103+
runTest("differentRowSpanWithGaps50OnSplitTest");
104+
}
105+
106+
@Test
107+
public void differentRowSpanWithGaps100OnSplitTest() throws IOException, InterruptedException {
108+
runTest("differentRowSpanWithGaps100OnSplitTest");
109+
}
110+
111+
@Test
112+
public void splitOn2ndRowGapTest() throws IOException, InterruptedException {
113+
runTest("splitOn2ndRowGapTest");
114+
}
115+
79116
@Test
80117
@LogMessages(messages = @LogMessage(messageTemplate = Html2PdfLogMessageConstant.GRID_TEMPLATE_AREAS_IS_INVALID))
81118
public void invalidTemplateAreasTest() throws IOException, InterruptedException {

src/test/java/com/itextpdf/html2pdf/css/grid/GridTemplateNestedTest.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,13 @@ public class GridTemplateNestedTest extends ExtendedHtmlConversionITextTest {
4040
public static final String DESTINATION_FOLDER = "./target/test/com/itextpdf/html2pdf/css/grid"
4141
+ "/GridTemplateNestedTest/";
4242

43-
//TODO DEVSIX-3340 change cmp files when GRID LAYOUT is supported
44-
4543
@BeforeAll
4644
public static void beforeClass() {
4745
createOrClearDestinationFolder(DESTINATION_FOLDER);
4846
}
4947

5048

5149
@Test
52-
// TODO DEVSIX-8382 Investigate weird background height in templateNestedAreasTest
5350
public void templateNestedAreasTest() throws IOException, InterruptedException {
5451
runTest("grid-nested-areas");
5552
}

src/test/java/com/itextpdf/html2pdf/css/grid/GridTemplatesTest.java

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ public void fixedTemplatesAndCellDoesNotHaveDirectNeighborTest() throws IOExcept
256256
runTest("fixedTemplatesAndCellDoesNotHaveDirectNeighborTest");
257257
}
258258

259+
@Test
259260
public void gridInsideGridTest() throws IOException, InterruptedException {
260261
runTest("gridInsideGridTest");
261262
}
@@ -266,7 +267,6 @@ public void gridInsideGridOnPageBreakTest() throws IOException, InterruptedExcep
266267
}
267268

268269
@Test
269-
// TODO DEVSIX-8340 - inner grid doesn't adjust its size
270270
public void elementDoesntFitContentTest() throws IOException, InterruptedException {
271271
runTest("elementDoesntFitContentTest");
272272
}
@@ -282,18 +282,20 @@ public void elementDoesntFitHorizontallyTest() throws IOException, InterruptedEx
282282
}
283283

284284
@Test
285-
// TODO DEVSIX-8340 - columns are not preserved
286285
public void elementDoesntFitOverflowingToNextPageTest() throws IOException, InterruptedException {
287286
runTest("elementDoesntFitOverflowingToNextPageTest");
288287
}
289288

290289
@Test
291-
// TODO DEVSIX-8340 - We don't try to split the cell.
292-
// TODO DEVSIX-8340 - We put the original amount of rows into overflow container.
293290
public void elementDoesntFitContentOverflowingToNextPageTest() throws IOException, InterruptedException {
294291
runTest("elementDoesntFitContentOverflowingToNextPageTest");
295292
}
296293

294+
@Test
295+
public void textsWithOverflowTest() throws IOException, InterruptedException {
296+
runTest("textsWithOverflowTest");
297+
}
298+
297299
@Test
298300
@LogMessages(messages = {
299301
@LogMessage(messageTemplate = LayoutLogMessageConstant.ELEMENT_DOES_NOT_FIT_AREA, logLevel =
@@ -322,13 +324,16 @@ public void gridWithPageBreakTest() throws IOException, InterruptedException {
322324
runTest("gridWithPageBreakTest");
323325
}
324326

325-
// TODO DEVSIX-8340 - table size is not recalculated on the next page
326-
// Same as in DEVSIX-8318
327327
@Test
328328
public void gridWithTableTest() throws IOException, InterruptedException {
329329
runTest("gridWithTableTest");
330330
}
331331

332+
@Test
333+
public void columnFlowOnSplitTest() throws IOException, InterruptedException {
334+
runTest("columnFlowOnSplitTest");
335+
}
336+
332337
@Test
333338
public void basicGridRemValuesTest() throws IOException, InterruptedException {
334339
runTest("grid-layout-rem");
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<style>
5+
.wrapper {
6+
display: grid;
7+
grid-template-columns: 1fr 2fr 3fr;
8+
grid-template-areas:
9+
"elem1 elem2 elem3"
10+
"elem1 elem4 elem5"
11+
"elem1 elem6 elem7";
12+
}
13+
14+
.wrapper {
15+
border: 2px solid #f76707;
16+
background-color: #fff4e6;
17+
}
18+
19+
.wrapper > div {
20+
border: 20px solid green;
21+
box-sizing: border-box;
22+
background-color: #ffd8a8;
23+
padding: 1em;
24+
margin: 1em;
25+
}
26+
</style>
27+
</head>
28+
29+
<body>
30+
<p>Some text</p>
31+
<div class="wrapper">
32+
<div style="grid-area: elem1">Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et
33+
dolore magna aliquyam erat, sed diam voluptua.</div>
34+
<div style="grid-area: elem2">Lorem ipsum dolor sit amet, consetetur sadipscing elitr.</div>
35+
<div style="grid-area: elem3">Lorem ipsum dolor sit amet, consetetur sadipscing elitr.</div>
36+
<div style="grid-area: elem4">Lorem ipsum dolor sit amet, consetetur sadipscing elitr.</div>
37+
<div style="grid-area: elem5">Lorem ipsum dolor sit amet, consetetur sadipscing elitr.</div>
38+
<div style="grid-area: elem6">Lorem ipsum dolor sit amet, consetetur sadipscing elitr.</div>
39+
<div style="grid-area: elem7">Lorem ipsum dolor sit amet, consetetur sadipscing elitr.</div>
40+
</div>
41+
<p>Some bottom text</p>
42+
</body>
43+
</html>
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)