@@ -1024,7 +1024,7 @@ describe("pat-tooltip", () => {
10241024 const instance = new pattern ( $el ) ;
10251025 await utils . timeout ( 1 ) ;
10261026
1027- const spy_content = jest . spyOn ( instance , "get_content " ) ;
1027+ const spy_content = jest . spyOn ( instance , "_get_content " ) ;
10281028 const spy_show = jest . spyOn ( instance . tippy . props , "onShow" ) ;
10291029
10301030 testutils . click ( $el ) ;
@@ -1057,7 +1057,7 @@ describe("pat-tooltip", () => {
10571057 const instance = new pattern ( $el ) ;
10581058 await utils . timeout ( 1 ) ;
10591059
1060- const spy_content = jest . spyOn ( instance , "get_content " ) ;
1060+ const spy_content = jest . spyOn ( instance , "_get_content " ) ;
10611061 const spy_show = jest . spyOn ( instance . tippy . props , "onShow" ) ;
10621062
10631063 testutils . click ( $el ) ;
@@ -1100,7 +1100,7 @@ describe("pat-tooltip", () => {
11001100 const instance = new pattern ( el ) ;
11011101 await utils . timeout ( 1 ) ;
11021102
1103- const spy_content = jest . spyOn ( instance , "get_content " ) ;
1103+ const spy_content = jest . spyOn ( instance , "_get_content " ) ;
11041104 const spy_show = jest . spyOn ( instance . tippy . props , "onShow" ) ;
11051105
11061106 el . click ( ) ;
@@ -1144,7 +1144,7 @@ describe("pat-tooltip", () => {
11441144 const instance = new pattern ( el ) ;
11451145 await utils . timeout ( 1 ) ;
11461146
1147- const spy_content = jest . spyOn ( instance , "get_content " ) ;
1147+ const spy_content = jest . spyOn ( instance , "_get_content " ) ;
11481148 const spy_show = jest . spyOn ( instance . tippy . props , "onShow" ) ;
11491149
11501150 el . click ( ) ;
@@ -1177,14 +1177,16 @@ describe("pat-tooltip", () => {
11771177 const instance = new pattern ( $el ) ;
11781178 await utils . timeout ( 1 ) ;
11791179
1180- const spy_content = jest . spyOn ( instance , "get_content" ) ;
1180+ const spy_content = jest . spyOn ( instance , "_get_content" ) ;
1181+ const spy_get_content = jest . spyOn ( instance , "get_content" ) ;
11811182 const spy_show = jest . spyOn ( instance . tippy . props , "onShow" ) ;
11821183
11831184 testutils . click ( $el ) ;
11841185 await utils . timeout ( 1 ) ; // wait a tick for async fetch
11851186
11861187 expect ( global . fetch ) . toHaveBeenCalled ( ) ;
11871188 expect ( spy_content ) . toHaveBeenCalled ( ) ;
1189+ expect ( spy_get_content ) . not . toHaveBeenCalled ( ) ;
11881190 expect ( spy_show ) . toHaveBeenCalled ( ) ;
11891191 expect ( document . querySelector ( ".tippy-box .tippy-content" ) . textContent ) . toBe (
11901192 "External content fetched via an HTTP request."
@@ -1198,6 +1200,7 @@ describe("pat-tooltip", () => {
11981200
11991201 expect ( global . fetch ) . toHaveBeenCalled ( ) ;
12001202 expect ( spy_content ) . toHaveBeenCalled ( ) ;
1203+ expect ( spy_get_content ) . toHaveBeenCalled ( ) ;
12011204 expect ( spy_show ) . toHaveBeenCalled ( ) ;
12021205 expect ( document . querySelector ( ".tippy-box .tippy-content" ) . textContent ) . toBe (
12031206 "Update!"
@@ -1252,9 +1255,9 @@ describe("pat-tooltip", () => {
12521255 const spy_prevent = jest
12531256 . spyOn ( click , "preventDefault" )
12541257 . mockImplementation ( ( ) => call_order . push ( "preventDefault" ) ) ;
1255- const spy_get_content = jest
1256- . spyOn ( instance , "get_content " )
1257- . mockImplementation ( ( ) => call_order . push ( "get_content " ) ) ;
1258+ const spy_content = jest
1259+ . spyOn ( instance , "_get_content " )
1260+ . mockImplementation ( ( ) => call_order . push ( "_get_content " ) ) ;
12581261
12591262 $el [ 0 ] . dispatchEvent ( click ) ;
12601263 await utils . timeout ( 1 ) ; // wait a tick for async fetch
@@ -1263,11 +1266,11 @@ describe("pat-tooltip", () => {
12631266 $el [ 0 ] . dispatchEvent ( click ) ;
12641267 await utils . timeout ( 1 ) ; // wait a tick for async fetch
12651268
1266- expect ( call_order . filter ( it => it === "get_content " ) . length ) . toEqual ( 1 ) ; // prettier-ignore
1269+ expect ( call_order . filter ( it => it === "_get_content " ) . length ) . toEqual ( 1 ) ; // prettier-ignore
12671270 expect ( call_order . filter ( it => it === "preventDefault" ) . length ) . toEqual ( 3 ) ; // prettier-ignore
12681271
12691272 spy_prevent . mockRestore ( ) ;
1270- spy_get_content . mockRestore ( ) ;
1273+ spy_content . mockRestore ( ) ;
12711274 global . fetch . mockRestore ( ) ;
12721275 delete global . fetch ;
12731276 } ) ;
@@ -1287,7 +1290,7 @@ describe("pat-tooltip", () => {
12871290 const instance = new pattern ( $el ) ;
12881291 await utils . timeout ( 1 ) ;
12891292
1290- const spy_ajax = jest . spyOn ( instance , "get_content " ) ;
1293+ const spy_ajax = jest . spyOn ( instance , "_get_content " ) ;
12911294 const spy_show = jest . spyOn ( instance . tippy . props , "onShow" ) ;
12921295
12931296 testutils . click ( $el ) ;
@@ -1315,7 +1318,7 @@ describe("pat-tooltip", () => {
13151318 const instance = await new pattern ( $el ) ;
13161319 await utils . timeout ( 1 ) ;
13171320
1318- const spy_ajax = jest . spyOn ( instance , "get_content " ) ;
1321+ const spy_ajax = jest . spyOn ( instance , "_get_content " ) ;
13191322 const spy_show = jest . spyOn ( instance . tippy . props , "onShow" ) ;
13201323
13211324 testutils . click ( $el ) ;
@@ -1353,7 +1356,7 @@ this will be extracted.
13531356 const instance = new pattern ( $el ) ;
13541357 await utils . timeout ( 1 ) ;
13551358
1356- const spy_ajax = jest . spyOn ( instance , "get_content " ) ;
1359+ const spy_ajax = jest . spyOn ( instance , "_get_content " ) ;
13571360 const spy_show = jest . spyOn ( instance . tippy . props , "onShow" ) ;
13581361
13591362 testutils . click ( $el ) ;
@@ -1390,7 +1393,7 @@ this will be extracted.
13901393 const instance = new pattern ( $el ) ;
13911394 await utils . timeout ( 1 ) ;
13921395
1393- const spy_ajax = jest . spyOn ( instance , "get_content " ) ;
1396+ const spy_ajax = jest . spyOn ( instance , "_get_content " ) ;
13941397 const spy_fetch = jest . spyOn ( window , "fetch" ) ;
13951398 const spy_show = jest . spyOn ( instance . tippy . props , "onShow" ) ;
13961399
@@ -1435,7 +1438,7 @@ this will be extracted.
14351438 const instance = new pattern ( $el ) ;
14361439 await utils . timeout ( 1 ) ;
14371440
1438- const spy_ajax = jest . spyOn ( instance , "get_content " ) ;
1441+ const spy_ajax = jest . spyOn ( instance , "_get_content " ) ;
14391442 const spy_fetch = jest . spyOn ( window , "fetch" ) ;
14401443 const spy_show = jest . spyOn ( instance . tippy . props , "onShow" ) ;
14411444
0 commit comments