@epa-wg/custom-element-dist 0.0.26 → 0.0.27
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/.idea/custom-element-dist.iml +1 -5
- package/.storybook/preview.ts +1 -1
- package/README.md +4 -4
- package/bin/vitest/vitest-browser-importmaps.mjs +20 -20
- package/coverage/coverage-final.json +9 -9
- package/coverage/index.html +25 -25
- 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 +467 -308
- package/coverage/src/custom-element/demo/index.html +1 -1
- package/coverage/src/custom-element/demo/z.js.html +1 -1
- package/coverage/src/custom-element/http-request.js.html +12 -12
- package/coverage/src/custom-element/index.html +20 -20
- package/coverage/src/custom-element/local-storage.js.html +56 -41
- package/coverage/src/custom-element/location-element.js.html +4 -4
- package/coverage/src/custom-element/module-url.js/coverage.svg +1 -1
- package/coverage/src/custom-element/module-url.js.html +16 -10
- 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.html +9 -12
- package/coverage/src/stories/coverage.svg +1 -1
- package/coverage/src/stories/css.test.stories.ts.html +1 -1
- package/coverage/src/stories/dom-merge.test.stories.ts.html +15 -9
- package/coverage/src/stories/external-template.test.stories.ts.html +8 -11
- package/coverage/src/stories/form.test.stories.ts.html +1 -1
- package/coverage/src/stories/http-request.stories.ts.html +1 -1
- package/coverage/src/stories/index.html +26 -26
- package/coverage/src/stories/local-storage.test.stories.ts/coverage.svg +1 -1
- package/coverage/src/stories/local-storage.test.stories.ts.html +87 -63
- package/coverage/src/stories/location-element.test.stories.ts.html +1 -1
- package/coverage/src/stories/module-url.test.stories.ts.html +1 -1
- package/coverage/src/stories/set-url.test.stories.ts.html +1 -1
- package/coverage/src/stories/slice-events.test.stories.ts.html +1 -1
- package/coverage/src/stories/slots.test.stories.ts.html +1 -1
- package/coverage/src/stories/testStoryBook.ts.html +1 -1
- package/coverage/src/stories/version-select.test.stories.ts.html +1 -1
- package/coverage/src/sum.ts.html +1 -1
- package/dist/{custom-element-b7c_7Kz4.js → custom-element-BMMsP1Dy.js} +204 -156
- package/dist/custom-element-CPSk7s0j.cjs +87 -0
- package/dist/custom-element-bundle.cjs +1 -1
- package/dist/custom-element-bundle.js +28 -25
- package/dist/demo/a.svg +27 -0
- package/dist/demo/demo.css +6 -7
- package/dist/demo/external-template.html +3 -3
- package/dist/demo/npm-versions-demo.html +21 -8
- package/dist/demo/npm-versions.html +54 -25
- package/dist/demo/s.xml +3 -28
- package/dist/demo/s.xslt +51 -92
- package/dist/demo/z.html +32 -61
- package/dist/demo/z1.html +34 -0
- package/dist/local-storage-78EivJ_B.cjs +1 -0
- package/dist/local-storage-DzmNKzgN.js +66 -0
- package/dist/mockServiceWorker.js +1 -1
- package/package.json +27 -25
- package/public/demo/a.svg +27 -0
- package/public/demo/demo.css +6 -7
- package/public/demo/external-template.html +3 -3
- package/public/demo/npm-versions-demo.html +21 -8
- package/public/demo/npm-versions.html +54 -25
- package/public/demo/s.xml +3 -28
- package/public/demo/s.xslt +51 -92
- package/public/demo/z.html +32 -61
- package/public/demo/z1.html +34 -0
- package/public/mockServiceWorker.js +1 -1
- package/src/custom-element/custom-element.js +67 -14
- package/src/custom-element/demo/a.svg +27 -0
- package/src/custom-element/demo/demo.css +6 -7
- package/src/custom-element/demo/external-template.html +3 -3
- package/src/custom-element/demo/npm-versions-demo.html +21 -8
- package/src/custom-element/demo/npm-versions.html +54 -25
- package/src/custom-element/demo/s.xml +3 -28
- package/src/custom-element/demo/s.xslt +51 -92
- package/src/custom-element/demo/z.html +32 -61
- package/src/custom-element/demo/z1.html +34 -0
- package/src/custom-element/ide/web-types-dce.json +1 -1
- package/src/custom-element/ide/web-types-xsl.json +1 -1
- package/src/custom-element/index.html +19 -2
- package/src/custom-element/local-storage.js +19 -14
- package/src/custom-element/module-url.js +3 -2
- package/src/mocks/versions.mock.ts +8 -8
- package/src/stories/__screenshots__/http-request.test.ts/http-request-url-change-1.png +0 -0
- package/src/stories/attributes.test.stories.ts +3 -4
- package/src/stories/dom-merge.test.stories.ts +9 -7
- package/src/stories/external-template.test.stories.ts +2 -3
- package/src/stories/local-storage.test.stories.ts +61 -53
- package/src/sum.test.ts +5 -5
- package/src/sum.ts +3 -3
- package/storybook-static/assets/{Color-KGDBMAHA-CH-YyWYq.js → Color-KGDBMAHA-CJo5gHY3.js} +1 -1
- package/storybook-static/assets/{Configure-DFL_bm2M.js → Configure-DdXbGKhY.js} +1 -1
- package/storybook-static/assets/{DocsRenderer-PKQXORMH-Bz-_1hmS.js → DocsRenderer-PKQXORMH-DLnpL5hE.js} +2 -2
- package/storybook-static/assets/{attributes.test.stories-DIQXccHc.js → attributes.test.stories-Bt5V18qO.js} +10 -11
- package/storybook-static/assets/{css.test.stories-BV2hi4CY.js → css.test.stories-CGYy2daE.js} +1 -1
- package/storybook-static/assets/{custom-element-wn23PUwN.js → custom-element-D8hcDZHh.js} +116 -82
- package/storybook-static/assets/{dom-merge.test.stories-Dws0C2-g.js → dom-merge.test.stories-XlsZ0UvX.js} +22 -20
- package/storybook-static/assets/{external-template.test.stories-BHO48b0j.js → external-template.test.stories-Bt_Pflu8.js} +7 -8
- package/storybook-static/assets/{form.test.stories-dv9mwp24.js → form.test.stories-B0NoI8wm.js} +1 -1
- package/storybook-static/assets/{handlers-CaCq2ZPF.js → handlers-B5969HUu.js} +13 -13
- package/storybook-static/assets/{http-request.stories-B2ke7LtS.js → http-request.stories-B2skuTFV.js} +1 -1
- package/storybook-static/assets/iframe-Dfrt81rk.js +2 -0
- package/storybook-static/assets/{index-BnXBQqj9.js → index-Ay195x2L.js} +4 -4
- package/storybook-static/assets/{index-sm7QlJZE.js → index-C3ChPTMh.js} +1 -1
- package/storybook-static/assets/{index-Dz4OaB2k.js → index-C7lvoJNv.js} +1 -1
- package/storybook-static/assets/{index-Cpxqn5iQ.js → index-Gpdhz4ab.js} +1 -1
- package/storybook-static/assets/local-storage.test.stories-DfY6feqG.js +420 -0
- package/storybook-static/assets/{location-element.test.stories-BiFvBop7.js → location-element.test.stories-944AotIJ.js} +1 -1
- package/storybook-static/assets/{module-url.test.stories-BXoM34tX.js → module-url.test.stories-DSKcwApl.js} +1 -1
- package/storybook-static/assets/preview-AJR7rVPD.js +52 -0
- package/storybook-static/assets/{preview-Cg7hXPRq.js → preview-CadgX-4y.js} +2 -2
- package/storybook-static/assets/{set-url.test.stories-Cg5Z0r7x.js → set-url.test.stories-DjLHKkEh.js} +1 -1
- package/storybook-static/assets/{slice-events.test.stories-D_ttGp3g.js → slice-events.test.stories-8I_BrHd6.js} +1 -1
- package/storybook-static/assets/{slots.test.stories-DBNXOm0T.js → slots.test.stories-CvZz4jyP.js} +1 -1
- package/storybook-static/assets/{version-select.test.stories-CgV3UCim.js → version-select.test.stories-DSxmJylI.js} +1 -1
- package/storybook-static/demo/a.svg +27 -0
- package/storybook-static/demo/demo.css +6 -7
- package/storybook-static/demo/external-template.html +3 -3
- package/storybook-static/demo/npm-versions-demo.html +21 -8
- package/storybook-static/demo/npm-versions.html +54 -25
- package/storybook-static/demo/s.xml +3 -28
- package/storybook-static/demo/s.xslt +51 -92
- package/storybook-static/demo/z.html +32 -61
- package/storybook-static/demo/z1.html +34 -0
- package/storybook-static/iframe.html +1 -1
- package/storybook-static/mockServiceWorker.js +1 -1
- package/storybook-static/project.json +1 -1
- package/storybook-static/sb-addons/chromatic-com-storybook-9/manager-bundle.js +39 -36
- package/storybook-static/sb-addons/chromatic-com-storybook-9/manager-bundle.js.LEGAL.txt +38 -1
- package/.idea/codeStyles/codeStyleConfig.xml +0 -5
- package/.idea/compiler.xml +0 -6
- package/.idea/inspectionProfiles/Project_Default.xml +0 -6
- package/.vscode/settings.json +0 -24
- package/dist/custom-element-CckoVsvO.cjs +0 -53
- package/dist/local-storage-Boafngui.cjs +0 -1
- package/dist/local-storage-BqDEu2kF.js +0 -59
- package/storybook-static/assets/iframe-D4Sos1HO.js +0 -2
- package/storybook-static/assets/local-storage.test.stories-BpogLNq-.js +0 -419
- package/storybook-static/assets/preview-oHxXRSIu.js +0 -48
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
<div class='clearfix'>
|
|
24
24
|
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
|
26
|
-
<span class="strong">
|
|
26
|
+
<span class="strong">7.23% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>
|
|
28
|
+
<span class='fraction'>17/235</span>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
31
|
|
|
@@ -37,16 +37,16 @@
|
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
<div class='fl pad1y space-right2'>
|
|
40
|
-
<span class="strong">
|
|
40
|
+
<span class="strong">13.33% </span>
|
|
41
41
|
<span class="quiet">Functions</span>
|
|
42
|
-
<span class='fraction'>2/
|
|
42
|
+
<span class='fraction'>2/15</span>
|
|
43
43
|
</div>
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
<div class='fl pad1y space-right2'>
|
|
47
|
-
<span class="strong">
|
|
47
|
+
<span class="strong">7.07% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>
|
|
49
|
+
<span class='fraction'>16/226</span>
|
|
50
50
|
</div>
|
|
51
51
|
|
|
52
52
|
|
|
@@ -463,7 +463,16 @@
|
|
|
463
463
|
<a name='L398'></a><a href='#L398'>398</a>
|
|
464
464
|
<a name='L399'></a><a href='#L399'>399</a>
|
|
465
465
|
<a name='L400'></a><a href='#L400'>400</a>
|
|
466
|
-
<a name='L401'></a><a href='#L401'>401</a
|
|
466
|
+
<a name='L401'></a><a href='#L401'>401</a>
|
|
467
|
+
<a name='L402'></a><a href='#L402'>402</a>
|
|
468
|
+
<a name='L403'></a><a href='#L403'>403</a>
|
|
469
|
+
<a name='L404'></a><a href='#L404'>404</a>
|
|
470
|
+
<a name='L405'></a><a href='#L405'>405</a>
|
|
471
|
+
<a name='L406'></a><a href='#L406'>406</a>
|
|
472
|
+
<a name='L407'></a><a href='#L407'>407</a>
|
|
473
|
+
<a name='L408'></a><a href='#L408'>408</a>
|
|
474
|
+
<a name='L409'></a><a href='#L409'>409</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
475
|
+
<span class="cline-any cline-neutral"> </span>
|
|
467
476
|
<span class="cline-any cline-neutral"> </span>
|
|
468
477
|
<span class="cline-any cline-neutral"> </span>
|
|
469
478
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -515,6 +524,10 @@
|
|
|
515
524
|
<span class="cline-any cline-neutral"> </span>
|
|
516
525
|
<span class="cline-any cline-neutral"> </span>
|
|
517
526
|
<span class="cline-any cline-neutral"> </span>
|
|
527
|
+
<span class="cline-any cline-yes">1x</span>
|
|
528
|
+
<span class="cline-any cline-yes">1x</span>
|
|
529
|
+
<span class="cline-any cline-yes">1x</span>
|
|
530
|
+
<span class="cline-any cline-neutral"> </span>
|
|
518
531
|
<span class="cline-any cline-neutral"> </span>
|
|
519
532
|
<span class="cline-any cline-yes">1x</span>
|
|
520
533
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -531,15 +544,17 @@
|
|
|
531
544
|
<span class="cline-any cline-no"> </span>
|
|
532
545
|
<span class="cline-any cline-no"> </span>
|
|
533
546
|
<span class="cline-any cline-no"> </span>
|
|
534
|
-
<span class="cline-any cline-neutral"> </span>
|
|
535
547
|
<span class="cline-any cline-no"> </span>
|
|
536
548
|
<span class="cline-any cline-no"> </span>
|
|
537
549
|
<span class="cline-any cline-no"> </span>
|
|
550
|
+
<span class="cline-any cline-neutral"> </span>
|
|
551
|
+
<span class="cline-any cline-no"> </span>
|
|
538
552
|
<span class="cline-any cline-no"> </span>
|
|
539
553
|
<span class="cline-any cline-no"> </span>
|
|
540
554
|
<span class="cline-any cline-no"> </span>
|
|
541
555
|
<span class="cline-any cline-neutral"> </span>
|
|
542
556
|
<span class="cline-any cline-no"> </span>
|
|
557
|
+
<span class="cline-any cline-neutral"> </span>
|
|
543
558
|
<span class="cline-any cline-no"> </span>
|
|
544
559
|
<span class="cline-any cline-no"> </span>
|
|
545
560
|
<span class="cline-any cline-no"> </span>
|
|
@@ -548,8 +563,8 @@
|
|
|
548
563
|
<span class="cline-any cline-no"> </span>
|
|
549
564
|
<span class="cline-any cline-no"> </span>
|
|
550
565
|
<span class="cline-any cline-neutral"> </span>
|
|
551
|
-
<span class="cline-any cline-neutral"> </span>
|
|
552
566
|
<span class="cline-any cline-no"> </span>
|
|
567
|
+
<span class="cline-any cline-neutral"> </span>
|
|
553
568
|
<span class="cline-any cline-no"> </span>
|
|
554
569
|
<span class="cline-any cline-no"> </span>
|
|
555
570
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -568,6 +583,7 @@
|
|
|
568
583
|
<span class="cline-any cline-no"> </span>
|
|
569
584
|
<span class="cline-any cline-no"> </span>
|
|
570
585
|
<span class="cline-any cline-no"> </span>
|
|
586
|
+
<span class="cline-any cline-no"> </span>
|
|
571
587
|
<span class="cline-any cline-neutral"> </span>
|
|
572
588
|
<span class="cline-any cline-no"> </span>
|
|
573
589
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -866,10 +882,11 @@
|
|
|
866
882
|
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">// noinspection DuplicatedCode
|
|
867
883
|
|
|
868
884
|
import type { StoryObj } from '@storybook/web-components';
|
|
869
|
-
import {expect,
|
|
885
|
+
import {expect, userEvent, within} from '@storybook/test';
|
|
870
886
|
|
|
871
887
|
import '../custom-element/custom-element.js';
|
|
872
888
|
import '../custom-element/local-storage.js';
|
|
889
|
+
import {localStorage_clear, localStorage_removeItem, localStorageSetItem} from "../custom-element";
|
|
873
890
|
|
|
874
891
|
type TProps = { title: string; slice: string; key: string; value:string; live:string; body:string};
|
|
875
892
|
const defs: TProps =
|
|
@@ -915,41 +932,47 @@ const meta =
|
|
|
915
932
|
|
|
916
933
|
export default meta;
|
|
917
934
|
|
|
935
|
+
window['localStorageSetItem'] = localStorageSetItem;
|
|
936
|
+
window['localStorage_clear'] = localStorage_clear;
|
|
937
|
+
window['localStorage_removeItem'] = localStorage_removeItem;
|
|
938
|
+
|
|
918
939
|
export const Demo:Story =
|
|
919
940
|
{ args : {title: 'live value', live:'live', body:`
|
|
920
941
|
<input placeholder="value for localStorage" id="textinput"
|
|
921
942
|
slice="${defs.slice}"
|
|
922
943
|
value="{ //${defs.slice} ?? '${ defs.value }' }"/>
|
|
923
|
-
<button onclick="
|
|
924
|
-
<button onclick="
|
|
925
|
-
<button onclick="
|
|
926
|
-
<button onclick="
|
|
944
|
+
<button onclick="localStorageSetItem('${defs.key}',textinput.value )">set</button>
|
|
945
|
+
<button onclick="localStorageSetItem('${defs.key}','text value' )">text value</button>
|
|
946
|
+
<button onclick="localStorageSetItem('${defs.key}','another text')">another text</button>
|
|
947
|
+
<button onclick="localStorage_removeItem('${defs.key}' )">set blank</button>
|
|
927
948
|
`}
|
|
928
949
|
, play: <span class="fstat-no" title="function not covered" >async ({</span>canvasElement}) =>
|
|
929
950
|
{
|
|
951
|
+
<span class="cstat-no" title="statement not covered" > localStorage_clear();</span>
|
|
930
952
|
const canvas = <span class="cstat-no" title="statement not covered" >within(canvasElement);</span>
|
|
931
953
|
<span class="cstat-no" title="statement not covered" > await canvas.findByText(Demo.args!.title as string);</span>
|
|
932
954
|
const val = <span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >()=> <span class="cstat-no" title="statement not covered" >c</span>anvas.getByTestId('slice-value').textContent</span></span>
|
|
933
|
-
|
|
955
|
+
<span class="cstat-no" title="statement not covered" > await userEvent.click(await canvas.findByText('set blank'));</span>
|
|
956
|
+
<span class="cstat-no" title="statement not covered" > await expect(localStorage.getItem(defs.key)).toEqual(null, 'from localStorage');</span>
|
|
957
|
+
<span class="cstat-no" title="statement not covered" > await expect( val() ).toEqual('');</span>
|
|
934
958
|
|
|
935
|
-
<span class="cstat-no" title="statement not covered" >
|
|
936
|
-
<span class="cstat-no" title="statement not covered" > expect(localStorage.getItem(defs.key)).toEqual(null, 'from localStorage');</span>
|
|
937
|
-
<span class="cstat-no" title="statement not covered" > expect( val() ).toEqual('');</span>
|
|
938
|
-
<span class="cstat-no" title="statement not covered" > byText('text value').click();</span>
|
|
959
|
+
<span class="cstat-no" title="statement not covered" > await userEvent.click(canvas.getByText('text value'));</span>
|
|
939
960
|
<span class="cstat-no" title="statement not covered" > await sleep(10);</span>
|
|
940
|
-
<span class="cstat-no" title="statement not covered" > expect(
|
|
961
|
+
<span class="cstat-no" title="statement not covered" > await expect(localStorage.getItem(defs.key)).toEqual('text value', 'from localStorage');</span>
|
|
962
|
+
<span class="cstat-no" title="statement not covered" > await expect( val() ).toEqual('text value');</span>
|
|
941
963
|
|
|
942
964
|
<span class="cstat-no" title="statement not covered" > window['textinput'].value = 'textinput.value';</span>
|
|
943
|
-
|
|
965
|
+
|
|
966
|
+
<span class="cstat-no" title="statement not covered" > await userEvent.click(canvas.getByText('set'));</span>
|
|
944
967
|
<span class="cstat-no" title="statement not covered" > await sleep(10);</span>
|
|
945
968
|
<span class="cstat-no" title="statement not covered" > expect( val() ).toEqual('textinput.value');</span>
|
|
946
969
|
|
|
947
|
-
<span class="cstat-no" title="statement not covered" >
|
|
970
|
+
<span class="cstat-no" title="statement not covered" > await userEvent.click(canvas.getByText('another text'));</span>
|
|
948
971
|
<span class="cstat-no" title="statement not covered" > await sleep(10);</span>
|
|
949
972
|
<span class="cstat-no" title="statement not covered" > expect( val() ).toEqual('another text');</span>
|
|
950
973
|
|
|
974
|
+
<span class="cstat-no" title="statement not covered" > await userEvent.click(canvas.getByText('set blank'));</span>
|
|
951
975
|
|
|
952
|
-
<span class="cstat-no" title="statement not covered" > byText('set blank').click();</span>
|
|
953
976
|
<span class="cstat-no" title="statement not covered" > await sleep(10);</span>
|
|
954
977
|
<span class="cstat-no" title="statement not covered" > expect( val() ).toEqual('');</span>
|
|
955
978
|
},
|
|
@@ -959,31 +982,32 @@ export const Demo:Story =
|
|
|
959
982
|
export const AlwaysOverride:Story =
|
|
960
983
|
{ args : {title: 'AlwaysOverride', live:'', value:'ABC', body:`
|
|
961
984
|
buttons are changing the localStorage value, but without 'live' attribute slice ^^ from <i>local-storage</i> is not updated<br/>
|
|
962
|
-
<button onclick="
|
|
963
|
-
<button onclick="
|
|
985
|
+
<button onclick="localStorageSetItem('${defs.key}','text value')">text value</button>
|
|
986
|
+
<button onclick="localStorage_removeItem('${defs.key}')">set blank</button>
|
|
964
987
|
`}
|
|
965
988
|
, play: <span class="fstat-no" title="function not covered" >async ({</span>canvasElement}) =>
|
|
966
989
|
{
|
|
967
990
|
const canvas = <span class="cstat-no" title="statement not covered" >within(canvasElement);</span>
|
|
968
991
|
<span class="cstat-no" title="statement not covered" > await canvas.findByText(AlwaysOverride.args!.title as string);</span>
|
|
969
|
-
const val = <span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >()=> <span class="cstat-no" title="statement not covered" >c</span>anvas.getByTestId('slice-value').textContent
|
|
970
|
-
|
|
992
|
+
const val = <span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >()=> <span class="cstat-no" title="statement not covered" >c</span>anvas.getByTestId('slice-value').textContent;</span></span>
|
|
993
|
+
const click = <span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >async (t</span>ext)=> <span class="cstat-no" title="statement not covered" >await userEvent.click( await canvas.findByText(text) );</span></span>
|
|
994
|
+
<span class="cstat-no" title="statement not covered" > await sleep(10);</span>
|
|
971
995
|
|
|
972
|
-
<span class="cstat-no" title="statement not covered" > expect(localStorage.getItem(defs.key)).toEqual('ABC'
|
|
996
|
+
<span class="cstat-no" title="statement not covered" > await expect( localStorage.getItem(defs.key)).toEqual('ABC');</span>
|
|
973
997
|
|
|
974
|
-
<span class="cstat-no" title="statement not covered" >
|
|
975
|
-
<span class="cstat-no" title="statement not covered" > expect(localStorage.getItem(defs.key)).toEqual(null, 'from localStorage');</span>
|
|
998
|
+
<span class="cstat-no" title="statement not covered" > await click('set blank')</span>
|
|
999
|
+
<span class="cstat-no" title="statement not covered" > await expect(localStorage.getItem(defs.key)).toEqual(null, 'from localStorage');</span>
|
|
976
1000
|
<span class="cstat-no" title="statement not covered" > await sleep(10);</span>
|
|
977
|
-
<span class="cstat-no" title="statement not covered" > expect( val() ).toEqual('ABC');</span>
|
|
1001
|
+
<span class="cstat-no" title="statement not covered" > await expect( val() ).toEqual('ABC');</span>
|
|
978
1002
|
|
|
979
|
-
<span class="cstat-no" title="statement not covered" >
|
|
1003
|
+
<span class="cstat-no" title="statement not covered" > await click('text value');</span>
|
|
980
1004
|
<span class="cstat-no" title="statement not covered" > await sleep(10);</span>
|
|
981
|
-
<span class="cstat-no" title="statement not covered" > expect(localStorage.getItem(defs.key)).toEqual('text value', 'from localStorage');</span>
|
|
982
|
-
<span class="cstat-no" title="statement not covered" > expect( val() ).toEqual('ABC');</span>
|
|
1005
|
+
<span class="cstat-no" title="statement not covered" > await expect(localStorage.getItem(defs.key)).toEqual('text value', 'from localStorage');</span>
|
|
1006
|
+
<span class="cstat-no" title="statement not covered" > await expect( val() ).toEqual('ABC');</span>
|
|
983
1007
|
|
|
984
|
-
<span class="cstat-no" title="statement not covered" >
|
|
1008
|
+
<span class="cstat-no" title="statement not covered" > await click('set blank');</span>
|
|
985
1009
|
<span class="cstat-no" title="statement not covered" > await sleep(10);</span>
|
|
986
|
-
<span class="cstat-no" title="statement not covered" > expect( val() ).toEqual('ABC');</span>
|
|
1010
|
+
<span class="cstat-no" title="statement not covered" > await expect( val() ).toEqual('ABC');</span>
|
|
987
1011
|
},
|
|
988
1012
|
};
|
|
989
1013
|
|
|
@@ -991,15 +1015,15 @@ export const FromStorageWithDefault:Story =
|
|
|
991
1015
|
{ args : {title: 'live value with defaults', live:'', value:'ABC', body:`
|
|
992
1016
|
|
|
993
1017
|
<local-storage key="attr2Key" slice="attr2-key" type="text" live="live" slice-value="@value ?? 'DEF2'"></local-storage>
|
|
994
|
-
<button onclick="
|
|
995
|
-
<button onclick="
|
|
1018
|
+
<button onclick="localStorage_removeItem('attr2Key')">clear key</button>
|
|
1019
|
+
<button onclick="localStorageSetItem('attr2Key','attr2Key value')">update attr2-key value</button>
|
|
996
1020
|
//attr2-key: <code data-testid="key2-value">{//attr2-key}</code><br/>
|
|
997
1021
|
|
|
998
1022
|
<local-storage key="attr3Key" slice="attr3-key" type="text" live="live" slice-value="@value ?? 'DEF3'"></local-storage>
|
|
999
|
-
<button onclick="
|
|
1000
|
-
<button onclick="
|
|
1023
|
+
<button onclick="localStorage_removeItem('attr3Key')">clear attr3-key key</button>
|
|
1024
|
+
<button onclick="localStorageSetItem('attr3Key','attr3Key value')">update attr3-key value</button>
|
|
1001
1025
|
//attr3-key: <code data-testid="key3-value">{//attr3-key}</code><br/>
|
|
1002
|
-
<button onclick="
|
|
1026
|
+
<button onclick="localStorage_clear()">clear localStorage</button>
|
|
1003
1027
|
`}
|
|
1004
1028
|
, play: <span class="fstat-no" title="function not covered" >async ({</span>canvasElement}) =>
|
|
1005
1029
|
{
|
|
@@ -1042,39 +1066,39 @@ export const TypeAttribute:Story =
|
|
|
1042
1066
|
<local-storage key="jsonKey" slice="json-key" type="json" live="live"></local-storage>
|
|
1043
1067
|
<input id="typesinput" placeholder="set value"><button onclick="
|
|
1044
1068
|
'textKey,dateKey,timeKey,localDateTimeKey,numberKey,jsonKey'.split(',')
|
|
1045
|
-
.map( k=>
|
|
1069
|
+
.map( k=> localStorageSetItem(k, typesinput.value) )
|
|
1046
1070
|
"> set to all</button><br>
|
|
1047
1071
|
<hr>
|
|
1048
1072
|
text-key:
|
|
1049
|
-
<button onclick="
|
|
1073
|
+
<button onclick="localStorageSetItem('textKey', 'ABC' )">ABC</button>
|
|
1050
1074
|
<code data-testid="text-key">{//text-key }</code><br>
|
|
1051
1075
|
date-key:
|
|
1052
|
-
<button onclick="
|
|
1053
|
-
<button onclick="
|
|
1054
|
-
<button onclick="
|
|
1076
|
+
<button onclick="localStorageSetItem('dateKey', '2024-04-20T03:58:42.131Z')">2024-04-21T03:58:42.131Z </button>
|
|
1077
|
+
<button onclick="localStorageSetItem('dateKey', new Date(Date.now()).toISOString())">now </button>
|
|
1078
|
+
<button onclick="localStorageSetItem('dateKey', 'ABC' )">date ABC - invalid </button>
|
|
1055
1079
|
<code data-testid="date-key">{//date-key }</code><br>
|
|
1056
1080
|
time-key:
|
|
1057
|
-
<button onclick="
|
|
1081
|
+
<button onclick="localStorageSetItem('timeKey', '13:30')">13:30 </button>
|
|
1058
1082
|
<code data-testid="time-key">{//time-key }</code><br>
|
|
1059
1083
|
local-date-time:
|
|
1060
|
-
<button onclick="
|
|
1084
|
+
<button onclick="localStorageSetItem('localDateTimeKey', '1977-04-01T14:00:30')">1977-04-01T14:00:30 - local </button>
|
|
1061
1085
|
<code data-testid="local-date-time">{//local-date-time}</code><br>
|
|
1062
1086
|
number-key:
|
|
1063
|
-
<button onclick="
|
|
1064
|
-
<button onclick="
|
|
1065
|
-
<button onclick="
|
|
1066
|
-
<button onclick="
|
|
1067
|
-
<button onclick="
|
|
1068
|
-
<button onclick="
|
|
1069
|
-
<button onclick="
|
|
1087
|
+
<button onclick="localStorageSetItem('numberKey', '2024' )">2024 - number </button>
|
|
1088
|
+
<button onclick="localStorageSetItem('numberKey', '24' )">24 - number </button>
|
|
1089
|
+
<button onclick="localStorageSetItem('numberKey', '1.23456e+5' )">1.23456e+5 </button>
|
|
1090
|
+
<button onclick="localStorageSetItem('numberKey', '0001' )">0001 </button>
|
|
1091
|
+
<button onclick="localStorageSetItem('numberKey', '000' )">000 </button>
|
|
1092
|
+
<button onclick="localStorageSetItem('numberKey', '0' )">0 </button>
|
|
1093
|
+
<button onclick="localStorageSetItem('numberKey', 'ABC' )">ABC - invalid, NaN </button>
|
|
1070
1094
|
<code data-testid="number-key">{//number-key }</code> <br>
|
|
1071
1095
|
<fieldset>
|
|
1072
1096
|
<legend>json-key: </legend>
|
|
1073
1097
|
|
|
1074
|
-
<button onclick="
|
|
1075
|
-
<button onclick="
|
|
1076
|
-
<button onclick="
|
|
1077
|
-
<button onclick="
|
|
1098
|
+
<button onclick="localStorageSetItem('jsonKey', JSON.stringify('ABC'))">'ABC' - string </button>
|
|
1099
|
+
<button onclick="localStorageSetItem('jsonKey', JSON.stringify(12.345))">12.345 - number </button>
|
|
1100
|
+
<button onclick="localStorageSetItem('jsonKey', JSON.stringify(window.JsonSample) )">a:1,b:'B' -json </button>
|
|
1101
|
+
<button onclick="localStorageSetItem('jsonKey', 'ABC' )">ABC - invalid </button><br>
|
|
1078
1102
|
json-key:<code data-testid="json-key"><xsl:apply-templates select="//json-key/value/@*|//json-key/text()|//json-key/value/text()" mode="json"></xsl:apply-templates></code>
|
|
1079
1103
|
</fieldset>
|
|
1080
1104
|
<xsl:template mode="json" match="*|@*">
|
|
@@ -1089,8 +1113,8 @@ export const TypeAttribute:Story =
|
|
|
1089
1113
|
<span class="cstat-no" title="statement not covered" > await canvas.findByText(TypeAttribute.args!.title as string);</span>
|
|
1090
1114
|
const 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>
|
|
1091
1115
|
, val = <span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >testId => <span class="cstat-no" title="statement not covered" >c</span>anvas.getByTestId(testId).textContent</span></span>
|
|
1092
|
-
, expectVal = <span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >(k</span>ey,value) => { <span class="cstat-no" title="statement not covered" >expect(val( key )).toEqual( value, key ) }</span>;</span>
|
|
1093
|
-
<span class="cstat-no" title="statement not covered" >
|
|
1116
|
+
, expectVal = <span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >(k</span>ey,value) => { <span class="cstat-no" title="statement not covered" >expect(val( key ).trim()).toEqual( value, key ) }</span>;</span>
|
|
1117
|
+
<span class="cstat-no" title="statement not covered" > localStorage_clear(); // cleanup before test</span>
|
|
1094
1118
|
<span class="cstat-no" title="statement not covered" > await sleep(10);</span>
|
|
1095
1119
|
|
|
1096
1120
|
<span class="cstat-no" title="statement not covered" > expectVal('text-key' ,'');</span>
|
|
@@ -1250,7 +1274,7 @@ export const TypeAttribute:Story =
|
|
|
1250
1274
|
<span class="cstat-no" title="statement not covered" > expectVal('time-key' ,'' );</span>
|
|
1251
1275
|
<span class="cstat-no" title="statement not covered" > expectVal('local-date-time','' );</span>
|
|
1252
1276
|
<span class="cstat-no" title="statement not covered" > expectVal('number-key' ,'NaN' );</span>
|
|
1253
|
-
<span class="cstat-no" title="statement not covered" > expectVal('json-key' ,'
|
|
1277
|
+
<span class="cstat-no" title="statement not covered" > expectVal('json-key' ,'a : 1b : B' );</span>
|
|
1254
1278
|
},
|
|
1255
1279
|
};
|
|
1256
1280
|
|
|
@@ -1270,7 +1294,7 @@ if( 'test' === import.meta.env.MODE &&
|
|
|
1270
1294
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
1271
1295
|
Code coverage generated by
|
|
1272
1296
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
1273
|
-
at 2024-09-
|
|
1297
|
+
at 2024-09-11T14:44:32.203Z
|
|
1274
1298
|
</div>
|
|
1275
1299
|
<script src="../../prettify.js"></script>
|
|
1276
1300
|
<script>
|
|
@@ -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-09-
|
|
508
|
+
at 2024-09-11T14:44:32.203Z
|
|
509
509
|
</div>
|
|
510
510
|
<script src="../../prettify.js"></script>
|
|
511
511
|
<script>
|
|
@@ -619,7 +619,7 @@ if( 'test' === import.meta.env.MODE &&
|
|
|
619
619
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
620
620
|
Code coverage generated by
|
|
621
621
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
622
|
-
at 2024-09-
|
|
622
|
+
at 2024-09-11T14:44:32.203Z
|
|
623
623
|
</div>
|
|
624
624
|
<script src="../../prettify.js"></script>
|
|
625
625
|
<script>
|
|
@@ -412,7 +412,7 @@ if ('test' === import.meta.env.MODE &&
|
|
|
412
412
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
413
413
|
Code coverage generated by
|
|
414
414
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
415
|
-
at 2024-09-
|
|
415
|
+
at 2024-09-11T14:44:32.203Z
|
|
416
416
|
</div>
|
|
417
417
|
<script src="../../prettify.js"></script>
|
|
418
418
|
<script>
|
|
@@ -670,7 +670,7 @@ if( 'test' === import.meta.env.MODE &&
|
|
|
670
670
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
671
671
|
Code coverage generated by
|
|
672
672
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
673
|
-
at 2024-09-
|
|
673
|
+
at 2024-09-11T14:44:32.203Z
|
|
674
674
|
</div>
|
|
675
675
|
<script src="../../prettify.js"></script>
|
|
676
676
|
<script>
|
|
@@ -721,7 +721,7 @@ if( 'test' === import.meta.env.MODE &&
|
|
|
721
721
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
722
722
|
Code coverage generated by
|
|
723
723
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
724
|
-
at 2024-09-
|
|
724
|
+
at 2024-09-11T14:44:32.203Z
|
|
725
725
|
</div>
|
|
726
726
|
<script src="../../prettify.js"></script>
|
|
727
727
|
<script>
|
|
@@ -154,7 +154,7 @@ export async function testStoryBook<TProps>( mod: Record<string, StoryO
|
|
|
154
154
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
155
155
|
Code coverage generated by
|
|
156
156
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
157
|
-
at 2024-09-
|
|
157
|
+
at 2024-09-11T14:44:32.203Z
|
|
158
158
|
</div>
|
|
159
159
|
<script src="../../prettify.js"></script>
|
|
160
160
|
<script>
|
|
@@ -376,7 +376,7 @@ if( 'test' === import.meta.env.MODE &&
|
|
|
376
376
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
377
377
|
Code coverage generated by
|
|
378
378
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
379
|
-
at 2024-09-
|
|
379
|
+
at 2024-09-11T14:44:32.203Z
|
|
380
380
|
</div>
|
|
381
381
|
<script src="../../prettify.js"></script>
|
|
382
382
|
<script>
|
package/coverage/src/sum.ts.html
CHANGED
|
@@ -79,7 +79,7 @@ export function sum(a: number, b: number) {
|
|
|
79
79
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
80
80
|
Code coverage generated by
|
|
81
81
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
82
|
-
at 2024-09-
|
|
82
|
+
at 2024-09-11T14:44:32.203Z
|
|
83
83
|
</div>
|
|
84
84
|
<script src="../prettify.js"></script>
|
|
85
85
|
<script>
|