@@ -78,13 +78,9 @@ test('Table', (t) => {
7878 u ( 'text' , '\n' ) ,
7979 u ( 'element' , { tagName : 'tr' , properties : { } } , [
8080 u ( 'text' , '\n' ) ,
81- u ( 'element' , { tagName : 'th' , properties : { align : undefined } } , [
82- u ( 'text' , 'a' )
83- ] ) ,
81+ u ( 'element' , { tagName : 'th' , properties : { } } , [ u ( 'text' , 'a' ) ] ) ,
8482 u ( 'text' , '\n' ) ,
85- u ( 'element' , { tagName : 'th' , properties : { align : undefined } } , [
86- u ( 'text' , 'b' )
87- ] ) ,
83+ u ( 'element' , { tagName : 'th' , properties : { } } , [ u ( 'text' , 'b' ) ] ) ,
8884 u ( 'text' , '\n' )
8985 ] ) ,
9086 u ( 'text' , '\n' )
@@ -94,5 +90,77 @@ test('Table', (t) => {
9490 'should not add a `tbody` if w/o second row'
9591 )
9692
93+ t . deepEqual (
94+ toHast ( { type : 'table' , children : [ ] } ) ,
95+ {
96+ type : 'element' ,
97+ tagName : 'table' ,
98+ properties : { } ,
99+ children : [ { type : 'text' , value : '\n' } ]
100+ } ,
101+ 'should handle a table node w/o rows'
102+ )
103+
104+ t . deepEqual (
105+ toHast ( {
106+ type : 'tableRow' ,
107+ children : [
108+ { type : 'tableCell' , children : [ { type : 'text' , value : 'a' } ] } ,
109+ { type : 'tableCell' , children : [ { type : 'text' , value : 'b' } ] }
110+ ]
111+ } ) ,
112+ {
113+ type : 'element' ,
114+ tagName : 'tr' ,
115+ properties : { } ,
116+ children : [
117+ { type : 'text' , value : '\n' } ,
118+ {
119+ type : 'element' ,
120+ tagName : 'td' ,
121+ properties : { } ,
122+ children : [ { type : 'text' , value : 'a' } ]
123+ } ,
124+ { type : 'text' , value : '\n' } ,
125+ {
126+ type : 'element' ,
127+ tagName : 'td' ,
128+ properties : { } ,
129+ children : [ { type : 'text' , value : 'b' } ]
130+ } ,
131+ { type : 'text' , value : '\n' }
132+ ]
133+ } ,
134+ 'should handle a table row node w/ cells'
135+ )
136+
137+ t . deepEqual (
138+ toHast ( { type : 'tableRow' , children : [ ] } ) ,
139+ {
140+ type : 'element' ,
141+ tagName : 'tr' ,
142+ properties : { } ,
143+ children : [ { type : 'text' , value : '\n' } ]
144+ } ,
145+ 'should handle a table row node w/o cells'
146+ )
147+
148+ t . deepEqual (
149+ toHast ( { type : 'tableCell' , children : [ { type : 'text' , value : 'a' } ] } ) ,
150+ {
151+ type : 'element' ,
152+ tagName : 'td' ,
153+ properties : { } ,
154+ children : [ { type : 'text' , value : 'a' } ]
155+ } ,
156+ 'should handle a table cell node w/ children'
157+ )
158+
159+ t . deepEqual (
160+ toHast ( { type : 'tableCell' , children : [ ] } ) ,
161+ { type : 'element' , tagName : 'td' , properties : { } , children : [ ] } ,
162+ 'should handle a table cell node w/o children'
163+ )
164+
97165 t . end ( )
98166} )
0 commit comments