@@ -12,15 +12,29 @@ describe('PostHTML-Parser test', function() {
12
12
expect ( parser ( html ) ) . to . eql ( tree ) ;
13
13
} ) ;
14
14
15
- it ( 'comment' , function ( ) {
15
+ it ( 'should be parse comment' , function ( ) {
16
+ expect ( parser ( '<!--comment-->' ) ) . to . eql ( [ '<!--comment-->' ] ) ;
17
+ } ) ;
18
+
19
+ it ( 'should be parse comment in content' , function ( ) {
16
20
expect ( parser ( '<div><!--comment--></div>' ) ) . to . eql ( [ { tag : 'div' , content : [ '<!--comment-->' ] } ] ) ;
17
21
} ) ;
18
22
19
- it ( 'last comment ' , function ( ) {
20
- expect ( parser ( '<!--comment-- >' ) ) . to . eql ( [ '<!--comment-- >' ] ) ;
23
+ it ( 'should be parse doctype ' , function ( ) {
24
+ expect ( parser ( '<!doctype html >' ) ) . to . eql ( [ '<!doctype html >' ] ) ;
21
25
} ) ;
22
26
23
- it ( 'doctype' , function ( ) {
27
+ it ( 'should be parse tag' , function ( ) {
28
+ expect ( parser ( '<html></html>' ) ) . to . eql ( [ { tag : 'html' } ] ) ;
29
+ } ) ;
30
+
31
+ it ( 'should be parse doctype and tag' , function ( ) {
24
32
expect ( parser ( '<!doctype html><html></html>' ) ) . to . eql ( [ '<!doctype html>' , { tag : 'html' } ] ) ;
25
33
} ) ;
34
+
35
+ it ( 'should be parse tag attrs' , function ( ) {
36
+ expect ( parser ( '<div id="id" class="class"></div>' ) ) . to . eql ( [ {
37
+ tag : 'div' , attrs : { id : 'id' , class : 'class' } }
38
+ ] ) ;
39
+ } ) ;
26
40
} ) ;
0 commit comments