@@ -51,6 +51,26 @@ const embedNodeWithURL: Node = {
5151 children : [ ]
5252}
5353
54+ const tableDataNode : Node = {
55+ type : NodeType . TABLE_DATA ,
56+ attrs : {
57+ rowSpan : 2 ,
58+ colSpan : 2 ,
59+ 'redactor-attributes' : { colSpan : 2 , rowSpan : 2 }
60+ } ,
61+ children : [ ]
62+ }
63+
64+ const tableHeadNode : Node = {
65+ type : NodeType . TABLE_HEAD ,
66+ attrs : {
67+ rowSpan : 2 ,
68+ colSpan : 2 ,
69+ 'redactor-attributes' : { colSpan : 2 , rowSpan : 2 }
70+ } ,
71+ children : [ ]
72+ }
73+
5474describe ( 'Default node render options' , ( ) => {
5575 it ( 'Should return document string' , done => {
5676 const renderString = ( defaultNodeOption [ NodeType . DOCUMENT ] as RenderNode ) ( node , next )
@@ -134,11 +154,11 @@ describe('Default node render options', () => {
134154 renderString = ( defaultNodeOption [ NodeType . TABLE_ROW ] as RenderNode ) ( node , next )
135155 expect ( renderString ) . toEqual ( '<tr>text</tr>' )
136156
137- renderString = ( defaultNodeOption [ NodeType . TABLE_HEAD ] as RenderNode ) ( node , next )
138- expect ( renderString ) . toEqual ( '<th>text</th>' )
157+ renderString = ( defaultNodeOption [ NodeType . TABLE_HEAD ] as RenderNode ) ( tableHeadNode , next )
158+ expect ( renderString ) . toEqual ( '<th rowspan=\"2\" colspan=\"2\" >text</th>' )
139159
140- renderString = ( defaultNodeOption [ NodeType . TABLE_DATA ] as RenderNode ) ( node , next )
141- expect ( renderString ) . toEqual ( '<td>text</td>' )
160+ renderString = ( defaultNodeOption [ NodeType . TABLE_DATA ] as RenderNode ) ( tableDataNode , next )
161+ expect ( renderString ) . toEqual ( '<td rowspan=\"2\" colspan=\"2\" >text</td>' )
142162
143163 done ( )
144164 } )
0 commit comments