File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed
Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change 1+ namespace AngleSharp . Js . Tests
2+ {
3+ using NUnit . Framework ;
4+ using System . Threading . Tasks ;
5+
6+ [ TestFixture ]
7+ public class DomTests
8+ {
9+ [ Test ]
10+ public async Task NodeHasChildNodesIsAFunction ( )
11+ {
12+ var result = await "document.createElement('div').hasChildNodes" . EvalScriptAsync ( ) ;
13+ Assert . AreEqual ( "function hasChildNodes() { [native code] }" , result ) ;
14+ }
15+
16+ [ Test ]
17+ public async Task NodeHasChildNodesWithoutChildren ( )
18+ {
19+ var result = await "document.createElement('div').hasChildNodes()" . EvalScriptAsync ( ) ;
20+ Assert . AreEqual ( "False" , result ) ;
21+ }
22+
23+ [ Test ]
24+ public async Task NodeHasChildNodesWithChildren ( )
25+ {
26+ var result = await "new DOMParser().parseFromString(`<div><input/></div>`, 'text/html').body.firstChild.hasChildNodes()" . EvalScriptAsync ( ) ;
27+ Assert . AreEqual ( "True" , result ) ;
28+ }
29+ }
30+ }
You can’t perform that action at this time.
0 commit comments