@epa-wg/custom-element-dist 0.0.22 → 0.0.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/coverage/coverage-final.json +13 -15
- package/coverage/index.html +30 -30
- package/coverage/src/custom-element/coverage.svg +1 -1
- package/coverage/src/custom-element/custom-element.js/coverage.svg +1 -1
- package/coverage/src/custom-element/custom-element.js.html +336 -312
- package/coverage/src/custom-element/http-request.js.html +10 -10
- package/coverage/src/custom-element/index.html +19 -49
- package/coverage/src/custom-element/local-storage.js.html +5 -5
- package/coverage/src/custom-element/location-element.js.html +1 -1
- package/coverage/src/index.html +1 -1
- package/coverage/src/mocks/handlers.ts.html +1 -1
- package/coverage/src/mocks/index.html +1 -1
- package/coverage/src/stories/attributes.test.stories.ts/coverage.svg +1 -1
- package/coverage/src/stories/attributes.test.stories.ts.html +85 -91
- package/coverage/src/stories/coverage.svg +1 -1
- package/coverage/src/stories/css.test.stories.ts/coverage.svg +1 -1
- package/coverage/src/stories/css.test.stories.ts.html +75 -78
- package/coverage/src/stories/dom-merge.test.stories.ts/coverage.svg +1 -1
- package/coverage/src/stories/dom-merge.test.stories.ts.html +302 -74
- package/coverage/src/stories/external-template.test.stories.ts/coverage.svg +1 -1
- package/coverage/src/stories/external-template.test.stories.ts.html +154 -154
- package/coverage/src/stories/form.test.stories.ts/coverage.svg +1 -1
- package/coverage/src/stories/form.test.stories.ts.html +83 -86
- package/coverage/src/stories/http-request.stories.ts.html +1 -1
- package/coverage/src/stories/index.html +104 -104
- package/coverage/src/stories/local-storage.test.stories.ts/coverage.svg +1 -1
- package/coverage/src/stories/local-storage.test.stories.ts.html +444 -444
- package/coverage/src/stories/location-element.test.stories.ts/coverage.svg +1 -1
- package/coverage/src/stories/location-element.test.stories.ts.html +96 -96
- package/coverage/src/stories/slice-events.test.stories.ts/coverage.svg +1 -1
- package/coverage/src/stories/slice-events.test.stories.ts.html +141 -141
- package/coverage/src/stories/slots.test.stories.ts/coverage.svg +1 -1
- package/coverage/src/stories/slots.test.stories.ts.html +120 -123
- package/coverage/src/stories/{renderPlay.ts.html → testStoryBook.ts.html} +45 -24
- package/coverage/src/sum.ts.html +1 -1
- package/dist/{custom-element-N-sWiqGK.cjs → custom-element-BDK7dcJN.cjs} +8 -8
- package/dist/{custom-element-BISbI4SU.js → custom-element-DqtzLkTG.js} +74 -66
- package/dist/custom-element-bundle.cjs +1 -1
- package/dist/custom-element-bundle.js +23 -22
- package/package.json +3 -3
- package/src/custom-element/custom-element.js +9 -1
- package/src/custom-element/demo/form.html +92 -46
- package/src/custom-element/demo/s.xml +9 -17
- package/src/custom-element/ide/web-types-dce.json +1 -1
- package/src/custom-element/ide/web-types-xsl.json +1 -1
- package/src/stories/attributes.test.stories.ts +9 -11
- package/src/stories/css.test.stories.ts +6 -7
- package/src/stories/dom-merge.test.stories.ts +81 -5
- package/src/stories/external-template.test.stories.ts +6 -6
- package/src/stories/form.test.stories.ts +6 -7
- package/src/stories/local-storage.test.stories.ts +7 -7
- package/src/stories/location-element.test.stories.ts +6 -6
- package/src/stories/slice-events.test.stories.ts +6 -6
- package/src/stories/slots.test.stories.ts +6 -7
- package/src/stories/testStoryBook.ts +28 -0
- package/storybook-static/assets/{Color-PRSJMWNM-e4s261EJ.js → Color-PRSJMWNM-y4ZsI1hY.js} +1 -1
- package/storybook-static/assets/{Configure-DWut7txe.js → Configure-CyLVkwlf.js} +1 -1
- package/storybook-static/assets/{DocsRenderer-K4EAMTCU-CaXVGjCl.js → DocsRenderer-K4EAMTCU-VRGUwRrq.js} +2 -2
- package/storybook-static/assets/{WithTooltip-KJL26V4Q--B8vdnMi.js → WithTooltip-KJL26V4Q-xdXH9Ztt.js} +1 -1
- package/storybook-static/assets/{attributes.test.stories-IuwazrdL.js → attributes.test.stories-BckCcyrF.js} +3 -2
- package/storybook-static/assets/{css.test.stories-D9WaxrEv.js → css.test.stories-B-QcObCF.js} +1 -1
- package/storybook-static/assets/{custom-element-BV8-hRQS.js → custom-element-BIxkVg7K.js} +5 -5
- package/storybook-static/assets/dom-merge.test.stories-CjXhjTQY.js +258 -0
- package/storybook-static/assets/{external-template.test.stories-Bpr_wxBo.js → external-template.test.stories-BBqyi0az.js} +1 -1
- package/storybook-static/assets/{form.test.stories-3tURbEdv.js → form.test.stories-DsIo1B4n.js} +1 -1
- package/storybook-static/assets/{formatter-2WMMO6ZP-SJtgH3vM.js → formatter-2WMMO6ZP-CThVcQxM.js} +1 -1
- package/storybook-static/assets/{http-request.stories-8K_qSs8C.js → http-request.stories-sXA_Y-VM.js} +1 -1
- package/storybook-static/assets/{iframe-CM82WlGY.js → iframe-DcDTQOmA.js} +2 -2
- package/storybook-static/assets/{index-DNL-IEpS.js → index-CUFHd5VD.js} +1 -1
- package/storybook-static/assets/{index-CEZitmnt.js → index-DPPi9iZu.js} +5 -5
- package/storybook-static/assets/{index-D1MP-Zis.js → index-VWixWKZ7.js} +1 -1
- package/storybook-static/assets/{local-storage.test.stories-CtisAQBB.js → local-storage.test.stories-Cs2v3QTS.js} +1 -1
- package/storybook-static/assets/{location-element.test.stories-5O_t_m4Y.js → location-element.test.stories-WkrQDzJJ.js} +1 -1
- package/storybook-static/assets/{preview-5Y0XiZgz.js → preview-p-Bwze-K.js} +2 -2
- package/storybook-static/assets/{slice-events.test.stories-BSXCLIA5.js → slice-events.test.stories-BRBBc0JT.js} +1 -1
- package/storybook-static/assets/{slots.test.stories-B1vqfHmN.js → slots.test.stories-r-i91k3y.js} +1 -1
- package/storybook-static/assets/{syntaxhighlighter-BP7B2CQK-BWFH_0wQ.js → syntaxhighlighter-BP7B2CQK-OnioRcs9.js} +1 -1
- package/storybook-static/iframe.html +1 -1
- package/storybook-static/index.json +1 -1
- package/storybook-static/project.json +1 -1
- package/tsconfig.json +31 -21
- package/coverage/src/custom-element/custom-element1-1.js/coverage.svg +0 -10
- package/coverage/src/custom-element/custom-element1-1.js.html +0 -2374
- package/coverage/src/custom-element/custom-element1.js/coverage.svg +0 -10
- package/coverage/src/custom-element/custom-element1.js.html +0 -2374
- package/src/custom-element/custom-element1-1.js +0 -763
- package/src/custom-element/custom-element1.js +0 -763
- package/src/custom-element/custom-element1.js0 +0 -750
- package/src/custom-element/custom-element2.js0 +0 -759
- package/src/custom-element/custom-element3.js0 +0 -763
- package/src/stories/renderPlay.ts +0 -21
- package/storybook-static/assets/dom-merge.test.stories-BhbNeum_.js +0 -137
- /package/coverage/src/stories/{renderPlay.ts → testStoryBook.ts}/coverage.svg +0 -0
|
@@ -23,30 +23,30 @@
|
|
|
23
23
|
<div class='clearfix'>
|
|
24
24
|
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
|
26
|
-
<span class="strong">
|
|
26
|
+
<span class="strong">19.35% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>
|
|
28
|
+
<span class='fraction'>12/62</span>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
|
33
33
|
<span class="strong">100% </span>
|
|
34
34
|
<span class="quiet">Branches</span>
|
|
35
|
-
<span class='fraction'>
|
|
35
|
+
<span class='fraction'>5/5</span>
|
|
36
36
|
</div>
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
<div class='fl pad1y space-right2'>
|
|
40
|
-
<span class="strong">
|
|
40
|
+
<span class="strong">12.5% </span>
|
|
41
41
|
<span class="quiet">Functions</span>
|
|
42
|
-
<span class='fraction'>
|
|
42
|
+
<span class='fraction'>2/16</span>
|
|
43
43
|
</div>
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
<div class='fl pad1y space-right2'>
|
|
47
|
-
<span class="strong">
|
|
47
|
+
<span class="strong">22% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>
|
|
49
|
+
<span class='fraction'>11/50</span>
|
|
50
50
|
</div>
|
|
51
51
|
|
|
52
52
|
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
</div>
|
|
62
62
|
</template>
|
|
63
63
|
</div>
|
|
64
|
-
<div class='status-line
|
|
64
|
+
<div class='status-line low'></div>
|
|
65
65
|
<pre><table class="coverage">
|
|
66
66
|
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
|
|
67
67
|
<a name='L2'></a><a href='#L2'>2</a>
|
|
@@ -226,7 +226,7 @@
|
|
|
226
226
|
<span class="cline-any cline-neutral"> </span>
|
|
227
227
|
<span class="cline-any cline-neutral"> </span>
|
|
228
228
|
<span class="cline-any cline-neutral"> </span>
|
|
229
|
-
<span class="cline-any cline-
|
|
229
|
+
<span class="cline-any cline-no"> </span>
|
|
230
230
|
<span class="cline-any cline-neutral"> </span>
|
|
231
231
|
<span class="cline-any cline-neutral"> </span>
|
|
232
232
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -283,27 +283,27 @@
|
|
|
283
283
|
<span class="cline-any cline-neutral"> </span>
|
|
284
284
|
<span class="cline-any cline-neutral"> </span>
|
|
285
285
|
<span class="cline-any cline-neutral"> </span>
|
|
286
|
-
<span class="cline-any cline-
|
|
287
|
-
<span class="cline-any cline-
|
|
288
|
-
<span class="cline-any cline-
|
|
289
|
-
<span class="cline-any cline-
|
|
290
|
-
<span class="cline-any cline-
|
|
291
|
-
<span class="cline-any cline-
|
|
286
|
+
<span class="cline-any cline-no"> </span>
|
|
287
|
+
<span class="cline-any cline-no"> </span>
|
|
288
|
+
<span class="cline-any cline-no"> </span>
|
|
289
|
+
<span class="cline-any cline-no"> </span>
|
|
290
|
+
<span class="cline-any cline-no"> </span>
|
|
291
|
+
<span class="cline-any cline-no"> </span>
|
|
292
292
|
<span class="cline-any cline-neutral"> </span>
|
|
293
|
-
<span class="cline-any cline-
|
|
294
|
-
<span class="cline-any cline-
|
|
295
|
-
<span class="cline-any cline-
|
|
293
|
+
<span class="cline-any cline-no"> </span>
|
|
294
|
+
<span class="cline-any cline-no"> </span>
|
|
295
|
+
<span class="cline-any cline-no"> </span>
|
|
296
296
|
<span class="cline-any cline-neutral"> </span>
|
|
297
|
-
<span class="cline-any cline-
|
|
298
|
-
<span class="cline-any cline-
|
|
299
|
-
<span class="cline-any cline-
|
|
297
|
+
<span class="cline-any cline-no"> </span>
|
|
298
|
+
<span class="cline-any cline-no"> </span>
|
|
299
|
+
<span class="cline-any cline-no"> </span>
|
|
300
300
|
<span class="cline-any cline-neutral"> </span>
|
|
301
|
-
<span class="cline-any cline-
|
|
302
|
-
<span class="cline-any cline-
|
|
301
|
+
<span class="cline-any cline-no"> </span>
|
|
302
|
+
<span class="cline-any cline-no"> </span>
|
|
303
303
|
<span class="cline-any cline-neutral"> </span>
|
|
304
|
-
<span class="cline-any cline-
|
|
305
|
-
<span class="cline-any cline-
|
|
306
|
-
<span class="cline-any cline-
|
|
304
|
+
<span class="cline-any cline-no"> </span>
|
|
305
|
+
<span class="cline-any cline-no"> </span>
|
|
306
|
+
<span class="cline-any cline-no"> </span>
|
|
307
307
|
<span class="cline-any cline-neutral"> </span>
|
|
308
308
|
<span class="cline-any cline-neutral"> </span>
|
|
309
309
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -316,29 +316,30 @@
|
|
|
316
316
|
<span class="cline-any cline-neutral"> </span>
|
|
317
317
|
<span class="cline-any cline-neutral"> </span>
|
|
318
318
|
<span class="cline-any cline-neutral"> </span>
|
|
319
|
-
<span class="cline-any cline-
|
|
320
|
-
<span class="cline-any cline-
|
|
321
|
-
<span class="cline-any cline-
|
|
322
|
-
<span class="cline-any cline-
|
|
323
|
-
<span class="cline-any cline-
|
|
324
|
-
<span class="cline-any cline-
|
|
325
|
-
<span class="cline-any cline-
|
|
319
|
+
<span class="cline-any cline-no"> </span>
|
|
320
|
+
<span class="cline-any cline-no"> </span>
|
|
321
|
+
<span class="cline-any cline-no"> </span>
|
|
322
|
+
<span class="cline-any cline-no"> </span>
|
|
323
|
+
<span class="cline-any cline-no"> </span>
|
|
324
|
+
<span class="cline-any cline-no"> </span>
|
|
325
|
+
<span class="cline-any cline-no"> </span>
|
|
326
326
|
<span class="cline-any cline-neutral"> </span>
|
|
327
|
-
<span class="cline-any cline-
|
|
328
|
-
<span class="cline-any cline-
|
|
329
|
-
<span class="cline-any cline-
|
|
330
|
-
<span class="cline-any cline-
|
|
331
|
-
<span class="cline-any cline-
|
|
332
|
-
<span class="cline-any cline-
|
|
333
|
-
<span class="cline-any cline-
|
|
327
|
+
<span class="cline-any cline-no"> </span>
|
|
328
|
+
<span class="cline-any cline-no"> </span>
|
|
329
|
+
<span class="cline-any cline-no"> </span>
|
|
330
|
+
<span class="cline-any cline-no"> </span>
|
|
331
|
+
<span class="cline-any cline-no"> </span>
|
|
332
|
+
<span class="cline-any cline-no"> </span>
|
|
333
|
+
<span class="cline-any cline-no"> </span>
|
|
334
|
+
<span class="cline-any cline-neutral"> </span>
|
|
335
|
+
<span class="cline-any cline-no"> </span>
|
|
336
|
+
<span class="cline-any cline-no"> </span>
|
|
337
|
+
<span class="cline-any cline-no"> </span>
|
|
338
|
+
<span class="cline-any cline-no"> </span>
|
|
339
|
+
<span class="cline-any cline-no"> </span>
|
|
340
|
+
<span class="cline-any cline-no"> </span>
|
|
341
|
+
<span class="cline-any cline-no"> </span>
|
|
334
342
|
<span class="cline-any cline-neutral"> </span>
|
|
335
|
-
<span class="cline-any cline-yes">1x</span>
|
|
336
|
-
<span class="cline-any cline-yes">1x</span>
|
|
337
|
-
<span class="cline-any cline-yes">1x</span>
|
|
338
|
-
<span class="cline-any cline-yes">1x</span>
|
|
339
|
-
<span class="cline-any cline-yes">1x</span>
|
|
340
|
-
<span class="cline-any cline-yes">1x</span>
|
|
341
|
-
<span class="cline-any cline-yes">1x</span>
|
|
342
343
|
<span class="cline-any cline-neutral"> </span>
|
|
343
344
|
<span class="cline-any cline-neutral"> </span>
|
|
344
345
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -348,7 +349,6 @@
|
|
|
348
349
|
<span class="cline-any cline-neutral"> </span>
|
|
349
350
|
<span class="cline-any cline-neutral"> </span>
|
|
350
351
|
<span class="cline-any cline-yes">1x</span>
|
|
351
|
-
<span class="cline-any cline-neutral"> </span>
|
|
352
352
|
<span class="cline-any cline-yes">1x</span>
|
|
353
353
|
<span class="cline-any cline-yes">1x</span>
|
|
354
354
|
<span class="cline-any cline-yes">1x</span>
|
|
@@ -371,7 +371,7 @@ const defs: TProps =
|
|
|
371
371
|
, body: ``
|
|
372
372
|
};
|
|
373
373
|
type Story = StoryObj<TProps>;
|
|
374
|
-
function sleep(
|
|
374
|
+
function <span class="fstat-no" title="function not covered" >sleep(m</span>s: number) { <span class="cstat-no" title="statement not covered" >return new Promise(<span class="fstat-no" title="function not covered" >(r</span>esolve) => <span class="cstat-no" title="statement not covered" >setTimeout(resolve, ms))</span>; }</span>
|
|
375
375
|
|
|
376
376
|
function render(args: TProps)
|
|
377
377
|
{
|
|
@@ -426,29 +426,29 @@ export const Demo:Story =
|
|
|
426
426
|
<button onclick="history.pushState( {'{}'},'', '/location.html?pushstate=p1&p2=P2#h1')">history.pushState</button>
|
|
427
427
|
<button onclick="history.replaceState( {'{}'},'', '/vacation.html?replaceState=r1&r2=R2#h2')">history.replaceState</button>
|
|
428
428
|
`}
|
|
429
|
-
, play: async ({canvasElement}) =>
|
|
429
|
+
, play: <span class="fstat-no" title="function not covered" >async ({</span>canvasElement}) =>
|
|
430
430
|
{
|
|
431
|
-
const canvas = within(canvasElement)
|
|
432
|
-
await canvas.findByText(Demo.args!.title as string)
|
|
433
|
-
const val = (
|
|
434
|
-
, byText = txt =>
|
|
435
|
-
, expectMatch = (l
|
|
436
|
-
, locationProps = 'href,origin,protocol,host,hostname,port,pathname,search,hash'.split(',')
|
|
431
|
+
const canvas = <span class="cstat-no" title="statement not covered" >within(canvasElement);</span>
|
|
432
|
+
<span class="cstat-no" title="statement not covered" > await canvas.findByText(Demo.args!.title as string);</span>
|
|
433
|
+
const val = <span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >(p</span>rop)=> <span class="cstat-no" title="statement not covered" >canvas.getByTestId('param-'+prop).textContent.trim()</span></span>
|
|
434
|
+
, byText = <span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >txt =><span class="cstat-no" title="statement not covered" >c</span>anvas.getByText(txt)</span></span>
|
|
435
|
+
, expectMatch = <span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >(l</span>,prop) => <span class="cstat-no" title="statement not covered" >expect( val(prop)).toEqual(l[prop],prop)</span></span>
|
|
436
|
+
, locationProps = <span class="cstat-no" title="statement not covered" >'href,origin,protocol,host,hostname,port,pathname,search,hash'.split(',');</span>
|
|
437
437
|
|
|
438
|
-
locationProps.forEach( prop=>
|
|
439
|
-
byText('history.pushState').click()
|
|
440
|
-
await sleep(100)
|
|
438
|
+
<span class="cstat-no" title="statement not covered" > locationProps.forEach( <span class="fstat-no" title="function not covered" >prop=><span class="cstat-no" title="statement not covered" >e</span>xpectMatch(window.location,prop) )</span></span>
|
|
439
|
+
<span class="cstat-no" title="statement not covered" > byText('history.pushState').click();</span>
|
|
440
|
+
<span class="cstat-no" title="statement not covered" > await sleep(100);</span>
|
|
441
441
|
|
|
442
|
-
expect(val('pathname')).toEqual('/location.html')
|
|
443
|
-
expect(val('search')).toEqual('?pushstate=p1&p2=P2')
|
|
444
|
-
locationProps.forEach( prop=>
|
|
442
|
+
<span class="cstat-no" title="statement not covered" > expect(val('pathname')).toEqual('/location.html');</span>
|
|
443
|
+
<span class="cstat-no" title="statement not covered" > expect(val('search')).toEqual('?pushstate=p1&p2=P2');</span>
|
|
444
|
+
<span class="cstat-no" title="statement not covered" > locationProps.forEach( <span class="fstat-no" title="function not covered" >prop=><span class="cstat-no" title="statement not covered" >e</span>xpectMatch(window.location,prop) )</span></span>
|
|
445
445
|
|
|
446
|
-
byText('history.replaceState').click()
|
|
447
|
-
await sleep(100)
|
|
446
|
+
<span class="cstat-no" title="statement not covered" > byText('history.replaceState').click();</span>
|
|
447
|
+
<span class="cstat-no" title="statement not covered" > await sleep(100);</span>
|
|
448
448
|
|
|
449
|
-
expect(val('pathname')).toEqual('/vacation.html')
|
|
450
|
-
expect(val('search')).toEqual('?replaceState=r1&r2=R2')
|
|
451
|
-
locationProps.forEach( prop=>
|
|
449
|
+
<span class="cstat-no" title="statement not covered" > expect(val('pathname')).toEqual('/vacation.html');</span>
|
|
450
|
+
<span class="cstat-no" title="statement not covered" > expect(val('search')).toEqual('?replaceState=r1&r2=R2');</span>
|
|
451
|
+
<span class="cstat-no" title="statement not covered" > locationProps.forEach( <span class="fstat-no" title="function not covered" >prop=><span class="cstat-no" title="statement not covered" >e</span>xpectMatch(window.location,prop) )</span></span>
|
|
452
452
|
},
|
|
453
453
|
};
|
|
454
454
|
|
|
@@ -459,44 +459,44 @@ export const SrcAttribute:Story =
|
|
|
459
459
|
<button onclick="document.querySelector('location-element').setAttribute('href','/location.html?a1=A1&b2=B2#h2')">/location.html?a1=A1&b2=B2#h2</button>
|
|
460
460
|
<button onclick="document.querySelector('location-element').setAttribute('href','/vacation.html?c1=C1&d2=D2#h3')">/vacation.html?c1=C1&d2=D2#h3</button>
|
|
461
461
|
`}
|
|
462
|
-
, play: async ({canvasElement}) =>
|
|
462
|
+
, play: <span class="fstat-no" title="function not covered" >async ({</span>canvasElement}) =>
|
|
463
463
|
{
|
|
464
|
-
const canvas = within(canvasElement)
|
|
465
|
-
await canvas.findByText(SrcAttribute.args!.title as string)
|
|
466
|
-
const val = (
|
|
467
|
-
, byText = txt =>
|
|
468
|
-
, expectMatch = (l
|
|
469
|
-
, locationProps = 'origin,protocol,host,hostname,port'.split(',')
|
|
470
|
-
locationProps.forEach( prop=>
|
|
464
|
+
const canvas = <span class="cstat-no" title="statement not covered" >within(canvasElement);</span>
|
|
465
|
+
<span class="cstat-no" title="statement not covered" > await canvas.findByText(SrcAttribute.args!.title as string);</span>
|
|
466
|
+
const val = <span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >(p</span>rop)=> <span class="cstat-no" title="statement not covered" >canvas.getByTestId('param-'+prop).textContent.trim()</span></span>
|
|
467
|
+
, byText = <span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >txt =><span class="cstat-no" title="statement not covered" >c</span>anvas.getByText(txt)</span></span>
|
|
468
|
+
, expectMatch = <span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >(l</span>,prop) => <span class="cstat-no" title="statement not covered" >expect( val(prop)).toEqual(l[prop],prop)</span></span>
|
|
469
|
+
, locationProps = <span class="cstat-no" title="statement not covered" >'origin,protocol,host,hostname,port'.split(',');</span>
|
|
470
|
+
<span class="cstat-no" title="statement not covered" > locationProps.forEach( <span class="fstat-no" title="function not covered" >prop=><span class="cstat-no" title="statement not covered" >e</span>xpectMatch(window.location,prop) )</span></span>
|
|
471
471
|
|
|
472
|
-
byText('/location.html?a1=A1&b2=B2#h2').click()
|
|
473
|
-
await sleep(10)
|
|
474
|
-
expect(val('pathname')).toEqual('/location.html', 'pathname #2')
|
|
475
|
-
expect(val('search')).toEqual('?a1=A1&b2=B2')
|
|
476
|
-
expect(val('hash')).toEqual('#h2')
|
|
477
|
-
expect(val('a1')).toEqual('A1')
|
|
478
|
-
expect(val('b2')).toEqual('B2')
|
|
472
|
+
<span class="cstat-no" title="statement not covered" > byText('/location.html?a1=A1&b2=B2#h2').click();</span>
|
|
473
|
+
<span class="cstat-no" title="statement not covered" > await sleep(10);</span>
|
|
474
|
+
<span class="cstat-no" title="statement not covered" > expect(val('pathname')).toEqual('/location.html', 'pathname #2');</span>
|
|
475
|
+
<span class="cstat-no" title="statement not covered" > expect(val('search')).toEqual('?a1=A1&b2=B2');</span>
|
|
476
|
+
<span class="cstat-no" title="statement not covered" > expect(val('hash')).toEqual('#h2');</span>
|
|
477
|
+
<span class="cstat-no" title="statement not covered" > expect(val('a1')).toEqual('A1');</span>
|
|
478
|
+
<span class="cstat-no" title="statement not covered" > expect(val('b2')).toEqual('B2');</span>
|
|
479
479
|
|
|
480
|
-
byText('/vacation.html?c1=C1&d2=D2#h3').click()
|
|
481
|
-
await sleep(10)
|
|
482
|
-
expect(val('pathname')).toEqual('/vacation.html', 'pathname #3')
|
|
483
|
-
expect(val('search')).toEqual('?c1=C1&d2=D2')
|
|
484
|
-
expect(val('hash')).toEqual('#h3')
|
|
485
|
-
expect(val('c1')).toEqual('C1')
|
|
486
|
-
expect(val('d2')).toEqual('D2')
|
|
480
|
+
<span class="cstat-no" title="statement not covered" > byText('/vacation.html?c1=C1&d2=D2#h3').click();</span>
|
|
481
|
+
<span class="cstat-no" title="statement not covered" > await sleep(10);</span>
|
|
482
|
+
<span class="cstat-no" title="statement not covered" > expect(val('pathname')).toEqual('/vacation.html', 'pathname #3');</span>
|
|
483
|
+
<span class="cstat-no" title="statement not covered" > expect(val('search')).toEqual('?c1=C1&d2=D2');</span>
|
|
484
|
+
<span class="cstat-no" title="statement not covered" > expect(val('hash')).toEqual('#h3');</span>
|
|
485
|
+
<span class="cstat-no" title="statement not covered" > expect(val('c1')).toEqual('C1');</span>
|
|
486
|
+
<span class="cstat-no" title="statement not covered" > expect(val('d2')).toEqual('D2');</span>
|
|
487
487
|
|
|
488
488
|
},
|
|
489
489
|
};
|
|
490
490
|
|
|
491
491
|
|
|
492
|
-
const TestStories = { Demo, SrcAttribute };
|
|
493
|
-
|
|
494
492
|
/* istanbul ignore else -- @preserve */
|
|
495
|
-
if(
|
|
493
|
+
if( 'test' === import.meta.env.MODE &&
|
|
494
|
+
!import.meta.url.includes('skiptest') )
|
|
496
495
|
{
|
|
497
|
-
const
|
|
498
|
-
const {
|
|
499
|
-
|
|
496
|
+
const mod = await import('./location-element.test.stories.ts?skiptest');
|
|
497
|
+
const { testStoryBook } = await import('./testStoryBook')
|
|
498
|
+
const { describe } = await import('vitest')
|
|
499
|
+
describe(meta.title, () => testStoryBook( mod, meta ) );
|
|
500
500
|
}
|
|
501
501
|
</pre></td></tr></table></pre>
|
|
502
502
|
|
|
@@ -505,7 +505,7 @@ if( 'test' === import.meta.env.MODE )
|
|
|
505
505
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
506
506
|
Code coverage generated by
|
|
507
507
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
508
|
-
at 2024-
|
|
508
|
+
at 2024-07-22T03:09:38.362Z
|
|
509
509
|
</div>
|
|
510
510
|
<script src="../../prettify.js"></script>
|
|
511
511
|
<script>
|