Skip to content

Commit 742a20c

Browse files
committed
Re-enable tests
1 parent 6988ec9 commit 742a20c

File tree

1 file changed

+79
-2
lines changed

1 file changed

+79
-2
lines changed

test/html_parser_test.dart

Lines changed: 79 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,33 @@ void main() {
3535
void testNewParser(BuildContext context) {
3636
HtmlParser.parseHTML("<b>Hello, World!</b>");
3737

38-
/*test("lexDomTree works correctly", () {
3938
StyledElement tree = HtmlParser.lexDomTree(
4039
HtmlParser.parseHTML(
4140
"Hello! <b>Hello, World!</b><i>Hello, New World!</i>"),
4241
[],
4342
[],
4443
null,
4544
context,
45+
HtmlParser(
46+
key: null,
47+
htmlData: HtmlParser.parseHTML(
48+
"Hello! <b>Hello, World!</b><i>Hello, New World!</i>"),
49+
onLinkTap: null,
50+
onAnchorTap: null,
51+
onImageTap: null,
52+
onCssParseError: null,
53+
onImageError: null,
54+
onMathError: null,
55+
shrinkWrap: false,
56+
selectable: true,
57+
style: {},
58+
customRenders: defaultRenders,
59+
imageRenders: defaultImageRenders,
60+
tagsList: Html.tags,
61+
navigationDelegateForIframe: null,
62+
selectionControls: null,
63+
scrollPhysics: null,
64+
)
4665
);
4766
print(tree.toString());
4867

@@ -53,6 +72,26 @@ void testNewParser(BuildContext context) {
5372
[],
5473
null,
5574
context,
75+
HtmlParser(
76+
key: null,
77+
htmlData: HtmlParser.parseHTML(
78+
"Hello, World! <a href='https://example.com'>This is a link</a>"),
79+
onLinkTap: null,
80+
onAnchorTap: null,
81+
onImageTap: null,
82+
onCssParseError: null,
83+
onImageError: null,
84+
onMathError: null,
85+
shrinkWrap: false,
86+
selectable: true,
87+
style: {},
88+
customRenders: defaultRenders,
89+
imageRenders: defaultImageRenders,
90+
tagsList: Html.tags,
91+
navigationDelegateForIframe: null,
92+
selectionControls: null,
93+
scrollPhysics: null,
94+
)
5695
);
5796
print(tree.toString());
5897

@@ -62,6 +101,25 @@ void testNewParser(BuildContext context) {
62101
[],
63102
null,
64103
context,
104+
HtmlParser(
105+
key: null,
106+
htmlData: HtmlParser.parseHTML("<img src='https://image.example.com' />"),
107+
onLinkTap: null,
108+
onAnchorTap: null,
109+
onImageTap: null,
110+
onCssParseError: null,
111+
onImageError: null,
112+
onMathError: null,
113+
shrinkWrap: false,
114+
selectable: true,
115+
style: {},
116+
customRenders: defaultRenders,
117+
imageRenders: defaultImageRenders,
118+
tagsList: Html.tags,
119+
navigationDelegateForIframe: null,
120+
selectionControls: null,
121+
scrollPhysics: null,
122+
)
65123
);
66124
print(tree.toString());
67125

@@ -72,9 +130,28 @@ void testNewParser(BuildContext context) {
72130
[],
73131
null,
74132
context,
133+
HtmlParser(
134+
key: null,
135+
htmlData: HtmlParser.parseHTML(
136+
"<div><div><div><div><a href='link'>Link</a><div>Hello, World! <b>Bold and <i>Italic</i></b></div></div></div></div></div>"),
137+
onLinkTap: null,
138+
onAnchorTap: null,
139+
onImageTap: null,
140+
onCssParseError: null,
141+
onImageError: null,
142+
onMathError: null,
143+
shrinkWrap: false,
144+
selectable: true,
145+
style: {},
146+
customRenders: defaultRenders,
147+
imageRenders: defaultImageRenders,
148+
tagsList: Html.tags,
149+
navigationDelegateForIframe: null,
150+
selectionControls: null,
151+
scrollPhysics: null,
152+
)
75153
);
76154
print(tree.toString());
77-
});*/
78155

79156
ReplacedElement videoContentElement = parseReplacedElement(
80157
HtmlParser.parseHTML("""

0 commit comments

Comments
 (0)