@@ -24,6 +24,8 @@ import LinkableHeading from 'docc-render/components/ContentNode/LinkableHeading.
2424import StrikeThrough from 'docc-render/components/ContentNode/StrikeThrough.vue' ;
2525import Small from '@/components/ContentNode/Small.vue' ;
2626import BlockVideo from '@/components/ContentNode/BlockVideo.vue' ;
27+ import Row from '@/components/ContentNode/Row.vue' ;
28+ import Column from '@/components/ContentNode/Column.vue' ;
2729
2830const { TableHeaderStyle } = ContentNode . constants ;
2931
@@ -342,6 +344,54 @@ describe('ContentNode', () => {
342344 } ) ;
343345 } ) ;
344346
347+ describe ( 'with type="row"' , ( ) => {
348+ it ( 'renders a `<Row>` and `<Column>`' , ( ) => {
349+ const wrapper = mountWithItem ( {
350+ type : 'row' ,
351+ numberOfColumns : 4 ,
352+ columns : [
353+ {
354+ size : 2 ,
355+ content : [
356+ {
357+ type : 'paragraph' ,
358+ inlineContent : [
359+ {
360+ type : 'text' ,
361+ text : 'foo' ,
362+ } ,
363+ ] ,
364+ } ,
365+ ] ,
366+ } ,
367+ {
368+ content : [
369+ {
370+ type : 'paragraph' ,
371+ inlineContent : [
372+ {
373+ type : 'text' ,
374+ text : 'bar' ,
375+ } ,
376+ ] ,
377+ } ,
378+ ] ,
379+ } ,
380+ ] ,
381+ } ) ;
382+ const grid = wrapper . find ( Row ) ;
383+ expect ( grid . props ( ) ) . toEqual ( {
384+ columns : 4 ,
385+ } ) ;
386+ const columns = grid . findAll ( Column ) ;
387+ expect ( columns ) . toHaveLength ( 2 ) ;
388+ expect ( columns . at ( 0 ) . props ( ) ) . toEqual ( { span : 2 } ) ;
389+ expect ( columns . at ( 0 ) . find ( 'p' ) . text ( ) ) . toBe ( 'foo' ) ;
390+ expect ( columns . at ( 1 ) . props ( ) ) . toEqual ( { span : null } ) ;
391+ expect ( columns . at ( 1 ) . find ( 'p' ) . text ( ) ) . toBe ( 'bar' ) ;
392+ } ) ;
393+ } ) ;
394+
345395 describe ( 'with type="codeVoice"' , ( ) => {
346396 it ( 'renders a `CodeVoice`' , ( ) => {
347397 const wrapper = mountWithItem ( {
@@ -1227,7 +1277,8 @@ describe('ContentNode', () => {
12271277
12281278 const content = wrapper . find ( StrikeThrough ) ;
12291279 // assert the `strong` tag is rendered
1230- expect ( content . html ( ) ) . toBe ( '<strikethrough-stub>2<strong>strong</strong></strikethrough-stub>' ) ;
1280+ expect ( content . html ( ) )
1281+ . toBe ( '<strikethrough-stub>2<strong>strong</strong></strikethrough-stub>' ) ;
12311282 } ) ;
12321283 } ) ;
12331284
0 commit comments