@@ -13,17 +13,17 @@ describe("parse", () => {
1313 '<div class="vce-row-container" data-vce-boxed-width="true"><div class="vce-row vce-row--col-gap-30 vce-row-equal-height vce-row-content--top" id="el-9a9a0daa" data-vce-do-apply="all el-9a9a0daa"><div class="vce-row-content" data-vce-element-content="true"><div class="vce-col vce-col--md-auto vce-col--xs-1 vce-col--xs-last vce-col--xs-first vce-col--sm-last vce-col--sm-first vce-col--md-last vce-col--lg-last vce-col--xl-last vce-col--md-first vce-col--lg-first vce-col--xl-first" id="el-8c088b93"><div class="vce-col-inner" data-vce-do-apply="border margin background el-8c088b93"><div class="vce-col-content" data-vce-element-content="true" data-vce-do-apply="padding el-8c088b93"><div></div></div></div></div></div></div></div><div class="vce-row-container" data-vce-boxed-width="true"><div class="vce-row vce-row--col-gap-30 vce-row-equal-height vce-row-content--top" id="el-f6493b28" data-vce-do-apply="all el-f6493b28"><div class="vce-row-content" data-vce-element-content="true"><div class="vce-col vce-col--md-auto vce-col--xs-1 vce-col--xs-last vce-col--xs-first vce-col--sm-last vce-col--sm-first vce-col--md-last vce-col--lg-last vce-col--xl-last vce-col--md-first vce-col--lg-first vce-col--xl-first" id="el-b5776850"><div class="vce-col-inner" data-vce-do-apply="border margin background el-b5776850"><div class="vce-col-content" data-vce-element-content="true" data-vce-do-apply="padding el-b5776850"><section class="vce-hero-section-container vce-hero-section-media--xs vce-hero-section-media--sm vce-hero-section-media--md vce-hero-section-media--lg"><div class="vce vce-hero-section" id="el-f2cf62c4" data-vce-do-apply="margin background border el-f2cf62c4"><div class="vce-hero-section--wrap-row vce-hero-section--background-position-center-center" style="background-image: url(\'\'); /* color: white; */ "><div class="vce-hero-section--wrap"><div class="vce-hero-section--content" data-vce-do-apply="padding el-f2cf62c4"><div class="vce-hero-section--content-container"><h1 style="color: #fff;">Highland Traditions of Scotland</h1>\n<p style="color: #fff;">The region became culturally distinguishable from the Lowlands from the later Middle Ages into the modern period.</p></div><div class="vce-button--style-basic-container vce-button--style-basic-container--align-center"><span class="vce-button--style-basic-wrapper vce" id="el-08abb633" data-vce-do-apply="margin el-08abb633"><button class="vce-button vce-button--style-basic vce-button--style-basic--border-square vce-button--style-basic--size-medium vce-button--style-basic--color-557cbf--fff" data-vce-do-apply="padding border background el-08abb633">Apply Now</button></span></div></div></div></div></div></section></div></div></div></div></div></div><div class="vce-row-container" data-vce-boxed-width="true"><div class="vce-row vce-row--col-gap-30 vce-row-equal-height vce-row-content--top" id="el-26c9385c" data-vce-do-apply="all el-26c9385c"><div class="vce-row-content" data-vce-element-content="true"><div class="vce-col vce-col--md-auto vce-col--xs-1 vce-col--xs-last vce-col--xs-first vce-col--sm-last vce-col--sm-first vce-col--md-last vce-col--lg-last vce-col--xl-last vce-col--md-first vce-col--lg-first vce-col--xl-first" id="el-c45b6ad5"><div class="vce-col-inner" data-vce-do-apply="border margin background el-c45b6ad5"><div class="vce-col-content" data-vce-element-content="true" data-vce-do-apply="padding el-c45b6ad5"><div class="vce-simple-image-slider" style="--backgroundPosition:center center; --pointerColor:#fff; --pointerColorHover:#fd9a00;"><div class="vce-simple-image-slider-wrapper vce" id="el-82299bdd" data-vce-do-apply="all el-82299bdd"><div class="vce-simple-image-slider-helper vce-simple-image-slider-aspect-ratio--3-4"><div class="vce-simple-image-slider-list" data-slick-autoplay="on" data-slick-autoplay-delay="5000" data-slick-effect="slideIn" data-slick-dots="on" data-slick-arrows="off"><div class="slick-list"><div class="slick-track"><div class="vce-simple-image-slider-item vc-slick-item"><div style="background-image:url(https://images.ctfassets.net/hrltx12pl8hq/7JnR6tVVwDyUM8Cbci3GtJ/bf74366cff2ba271471725d0b0ef418c/shutterstock_376532611-og.jpg)" class="vce-simple-image-slider-img vce-simple-image-slider-img--scale"><img class="" src="https://cdn.pixabay.com/photo/2018/08/14/13/23/ocean-3605547__340.jpg" style="opacity:0" alt=""></div></div></div></div></div><div class="vce-simple-image-slider-dots"></div></div></div></div></div></div></div></div></div></div>'
1414 ) ;
1515
16- const { container } = render ( node ) ;
16+ const { container } = render ( < > { node } </ > ) ;
1717
1818 expect ( container ) . toBeVisible ( ) ;
1919 } ) ;
2020
2121 it ( "should return empty fragment for empty string" , ( ) => {
2222 const node = parse ( "" ) ;
2323
24- expect ( node ) . toStrictEqual ( < > </ > ) ;
24+ expect ( node ) . toStrictEqual ( < > { "" } </ > ) ;
2525
26- const { container } = render ( node ) ;
26+ const { container } = render ( < > { node } </ > ) ;
2727
2828 expect ( container ) . toBeVisible ( ) ;
2929 } ) ;
@@ -35,22 +35,25 @@ describe("parse", () => {
3535 const node = parse ( null , { onError } ) ;
3636
3737 expect ( onError ) . toBeCalled ( ) ;
38- expect ( onError ) . toBeCalledWith ( new TypeError ( "HTML must be a string" ) ) ;
39- expect ( node ) . toStrictEqual ( < > </ > ) ;
38+ expect ( onError ) . toBeCalledWith (
39+ new TypeError ( "HTML must be a string" ) ,
40+ null
41+ ) ;
42+ expect ( node ) . toStrictEqual ( null ) ;
4043 } ) ;
4144
4245 it ( "should return empty fragment and invoke onError if we got not a string after sanitize" , ( ) => {
43- const onError = jest . fn ( ) ;
46+ const onError = jest . fn ( ( ) => { } ) ;
4447 const sanitize = jest . fn ( ( _ : string ) => null ) ;
45-
4648 //@ts -ignore
4749 const node = parse ( "<div></div>" , { onError, sanitize } ) ;
4850
4951 expect ( onError ) . toBeCalled ( ) ;
5052 expect ( onError ) . toBeCalledWith (
51- new TypeError ( "Sanitized HTML must be a string" )
53+ new TypeError ( "Sanitized HTML must be a string" ) ,
54+ null
5255 ) ;
53- expect ( node ) . toStrictEqual ( < > </ > ) ;
56+ expect ( node ) . toStrictEqual ( null ) ;
5457 } ) ;
5558
5659 it ( "should parse components" , ( ) => {
@@ -69,10 +72,11 @@ describe("parse", () => {
6972 attrsMap : {
7073 hello : "world" ,
7174 } ,
75+ onError : ( ) => { } ,
7276 }
7377 ) ;
7478
75- const { getByText, container } = render ( node ) ;
79+ const { getByText, container } = render ( < > { node } </ > ) ;
7680
7781 expect ( container . innerHTML ) . toMatchInlineSnapshot (
7882 `"Hello,<b>!</b><div class="active" style="color: red; font-size-adjust: initial; font-weight: 600;" id="">, world<b>!</b><b></b></div><input type="text" value="Submit">"`
0 commit comments