Skip to content

Commit 57ad54d

Browse files
SnipxiText-CI
authored andcommitted
Add new test demonstrating pdfHTML being too lenient when treating font CSS property
DEVSIX-3373
1 parent 1d64c4f commit 57ad54d

File tree

3 files changed

+34
-0
lines changed

3 files changed

+34
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package com.itextpdf.html2pdf.css;
2+
3+
import com.itextpdf.html2pdf.ExtendedHtmlConversionITextTest;
4+
import com.itextpdf.test.annotations.type.IntegrationTest;
5+
import org.junit.BeforeClass;
6+
import org.junit.Test;
7+
import org.junit.experimental.categories.Category;
8+
9+
import java.io.IOException;
10+
11+
@Category(IntegrationTest.class)
12+
public class FontPropertyTest extends ExtendedHtmlConversionITextTest {
13+
public static final String sourceFolder = "./src/test/resources/com/itextpdf/html2pdf/css/FontPropertyTest/";
14+
public static final String destinationFolder = "./target/test/com/itextpdf/html2pdf/css/FontPropertyTest/";
15+
16+
@BeforeClass
17+
public static void beforeClass() {
18+
createDestinationFolder(destinationFolder);
19+
}
20+
21+
@Test
22+
// TODO DEVSIX-3373: Fix cmp file after the bug is fixed. Currently, Helvetica font is picked up while the default one should be used
23+
public void fontShorthandContainingOnlyFontFamilyTest() throws IOException, InterruptedException {
24+
convertToPdfAndCompare("fontShorthandContainingOnlyFontFamily", sourceFolder, destinationFolder);
25+
}
26+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<!DOCTYPE html>
2+
<html>
3+
4+
<body>
5+
<p style="font:Helvetica">The content of the body element is displayed in your browser.</p>
6+
</body>
7+
8+
</html>

0 commit comments

Comments
 (0)