@@ -25,7 +25,10 @@ import {
2525 entryJsonRteWithId ,
2626 entryJsonRteWithIdinAttrs ,
2727 jsonRteClassAndIdAttrs ,
28- styleObj } from './mock/json-element-mock'
28+ styleObj ,
29+ unorderListJson1 ,
30+ unorderListJson2 ,
31+ orderListJson2 , } from './mock/json-element-mock'
2932import {
3033 blockquoteHtml ,
3134 codeHtml ,
@@ -338,7 +341,21 @@ describe('Node parse list content', () => {
338341 expect ( entry . supercharged_rte ) . toEqual ( orderListHtml )
339342 done ( )
340343 } )
344+ it ( 'Should return order list html content for updated json rte' , done => {
345+ const entry = {
346+ uid : 'entry_uid_19' ,
347+ supercharged_rte : {
348+ ...orderListJson2
349+ } ,
350+ _embedded_items : { }
351+ }
352+ const paths = [ 'supercharged_rte' ]
353+
354+ jsonToHTML ( { entry, paths} )
341355
356+ expect ( entry . supercharged_rte ) . toEqual ( '<ol><li><fragment>One</fragment><ol><li><strong>nested</strong> one</li><li>nested two</li></ol></li><li>Two</li></ol>' )
357+ done ( )
358+ } )
342359 it ( 'Should return un-order list html content' , done => {
343360 const entry = {
344361 uid : 'entry_uid_19' ,
@@ -354,6 +371,36 @@ describe('Node parse list content', () => {
354371 expect ( entry . supercharged_rte ) . toEqual ( unorderListHtml )
355372 done ( )
356373 } )
374+ it ( 'Should return unorder list html content for previous json rte ' , done => {
375+ const entry = {
376+ uid : 'entry_uid_19' ,
377+ supercharged_rte : {
378+ ...unorderListJson1
379+ } ,
380+ _embedded_items : { }
381+ }
382+ const paths = [ 'supercharged_rte' ]
383+
384+ jsonToHTML ( { entry, paths} )
385+
386+ expect ( entry . supercharged_rte ) . toEqual ( '<ul><li>One</li><ul><li>nested one</li><li>nested two</li></ul><li>Two</li></ul>' )
387+ done ( )
388+ } )
389+ it ( 'Should return unorder list html content for updated json rte' , done => {
390+ const entry = {
391+ uid : 'entry_uid_19' ,
392+ supercharged_rte : {
393+ ...unorderListJson2
394+ } ,
395+ _embedded_items : { }
396+ }
397+ const paths = [ 'supercharged_rte' ]
398+
399+ jsonToHTML ( { entry, paths} )
400+
401+ expect ( entry . supercharged_rte ) . toEqual ( '<ul><li><fragment>One</fragment><ul><li>nested one </li><li>nested two </li></ul></li><li>Two</li></ul>' )
402+ done ( )
403+ } )
357404} )
358405
359406describe ( 'Node parse image content' , ( ) => {
0 commit comments