@spectrum-web-components/coachmark 1.0.2 → 1.0.3

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.
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ import "@spectrum-web-components/coachmark/sp-coachmark.js";
3
+ import "@spectrum-web-components/coachmark/sp-coach-indicator.js";
4
+ import "@spectrum-web-components/overlay/sp-overlay.js";
5
+ import { html } from "lit";
6
+ import { measureFixtureCreation } from "../../../../test/benchmark/helpers.js";
7
+ measureFixtureCreation(html`
8
+ <sp-coach-indicator id="trigger"></sp-coach-indicator>
9
+ <sp-overlay
10
+ trigger="trigger@hover"
11
+ placement="right"
12
+ .receivesFocus=${"false"}
13
+ open
14
+ >
15
+ <sp-coachmark open primary-cta="Ok">
16
+ <div slot="title">A single coachmark</div>
17
+ <div slot="content">
18
+ This is a Coachmark with nothing but text in it. Kind of lonely
19
+ in here.
20
+ </div>
21
+ </sp-coachmark>
22
+ </sp-overlay>
23
+ `);
24
+ //# sourceMappingURL=basic-test.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["basic-test.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport '@spectrum-web-components/coachmark/sp-coachmark.js';\nimport '@spectrum-web-components/coachmark/sp-coach-indicator.js';\nimport '@spectrum-web-components/overlay/sp-overlay.js';\nimport { html } from 'lit';\nimport { measureFixtureCreation } from '../../../../test/benchmark/helpers.js';\n\nmeasureFixtureCreation(html`\n <sp-coach-indicator id=\"trigger\"></sp-coach-indicator>\n <sp-overlay\n trigger=\"trigger@hover\"\n placement=\"right\"\n .receivesFocus=${'false'}\n open\n >\n <sp-coachmark open primary-cta=\"Ok\">\n <div slot=\"title\">A single coachmark</div>\n <div slot=\"content\">\n This is a Coachmark with nothing but text in it. Kind of lonely\n in here.\n </div>\n </sp-coachmark>\n </sp-overlay>\n`);\n"],
5
+ "mappings": ";AAYA,OAAO;AACP,OAAO;AACP,OAAO;AACP,SAAS,YAAY;AACrB,SAAS,8BAA8B;AAEvC,uBAAuB;AAAA;AAAA;AAAA;AAAA;AAAA,yBAKE,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAW/B;",
6
+ "names": []
7
+ }
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ import { html } from "@open-wc/testing";
3
+ import "@spectrum-web-components/coachmark/sp-coach-indicator.js";
4
+ import { testForMemoryLeaks } from "../../../test/testing-helpers.js";
5
+ testForMemoryLeaks(html`
6
+ <sp-coach-indicator></sp-coach-indicator>
7
+ `);
8
+ //# sourceMappingURL=coach-indicator-memory.test.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["coach-indicator-memory.test.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2023 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport { html } from '@open-wc/testing';\nimport '@spectrum-web-components/coachmark/sp-coach-indicator.js';\nimport { testForMemoryLeaks } from '../../../test/testing-helpers.js';\n\ntestForMemoryLeaks(html`\n <sp-coach-indicator></sp-coach-indicator>\n`);\n"],
5
+ "mappings": ";AAWA,SAAS,YAAY;AACrB,OAAO;AACP,SAAS,0BAA0B;AAEnC,mBAAmB;AAAA;AAAA,CAElB;",
6
+ "names": []
7
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ import * as stories from "../stories/coach-indicator-static.stories.js";
3
+ import { regressVisuals } from "../../../test/visual/test.js";
4
+ regressVisuals("CoachIndicatorStaticStories", stories);
5
+ //# sourceMappingURL=coach-indicator-static.test-vrt.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["coach-indicator-static.test-vrt.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport * as stories from '../stories/coach-indicator-static.stories.js';\nimport { regressVisuals } from '../../../test/visual/test.js';\nimport type { TestsType } from '../../../test/visual/test.js';\n\nregressVisuals('CoachIndicatorStaticStories', stories as unknown as TestsType);\n"],
5
+ "mappings": ";AAYA,YAAY,aAAa;AACzB,SAAS,sBAAsB;AAG/B,eAAe,+BAA+B,OAA+B;",
6
+ "names": []
7
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ import * as stories from "../stories/coach-indicator.stories.js";
3
+ import { regressVisuals } from "../../../test/visual/test.js";
4
+ regressVisuals("CoachIndicatorStories", stories);
5
+ //# sourceMappingURL=coach-indicator.test-vrt.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["coach-indicator.test-vrt.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport * as stories from '../stories/coach-indicator.stories.js';\nimport { regressVisuals } from '../../../test/visual/test.js';\nimport type { TestsType } from '../../../test/visual/test.js';\n\nregressVisuals('CoachIndicatorStories', stories as unknown as TestsType);\n"],
5
+ "mappings": ";AAYA,YAAY,aAAa;AACzB,SAAS,sBAAsB;AAG/B,eAAe,yBAAyB,OAA+B;",
6
+ "names": []
7
+ }
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ import { elementUpdated, expect, fixture, html } from "@open-wc/testing";
3
+ import "@spectrum-web-components/coachmark/sp-coach-indicator.js";
4
+ import { testForLitDevWarnings } from "../../../test/testing-helpers.js";
5
+ describe("CoachIndicator", () => {
6
+ testForLitDevWarnings(
7
+ async () => await fixture(html`
8
+ <sp-coach-indicator></sp-coach-indicator>
9
+ `)
10
+ );
11
+ it("loads default coach-indicator accessibly", async () => {
12
+ const el = await fixture(html`
13
+ <sp-coach-indicator></sp-coach-indicator>
14
+ `);
15
+ await elementUpdated(el);
16
+ await expect(el).to.be.accessible();
17
+ });
18
+ });
19
+ //# sourceMappingURL=coach-indicator.test.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["coach-indicator.test.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2023 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\nimport { elementUpdated, expect, fixture, html } from '@open-wc/testing';\n\nimport '@spectrum-web-components/coachmark/sp-coach-indicator.js';\nimport { CoachIndicator } from '@spectrum-web-components/coachmark';\nimport { testForLitDevWarnings } from '../../../test/testing-helpers.js';\n\ndescribe('CoachIndicator', () => {\n testForLitDevWarnings(\n async () =>\n await fixture<CoachIndicator>(html`\n <sp-coach-indicator></sp-coach-indicator>\n `)\n );\n it('loads default coach-indicator accessibly', async () => {\n const el = await fixture<CoachIndicator>(html`\n <sp-coach-indicator></sp-coach-indicator>\n `);\n await elementUpdated(el);\n await expect(el).to.be.accessible();\n });\n});\n"],
5
+ "mappings": ";AAWA,SAAS,gBAAgB,QAAQ,SAAS,YAAY;AAEtD,OAAO;AAEP,SAAS,6BAA6B;AAEtC,SAAS,kBAAkB,MAAM;AAC7B;AAAA,IACI,YACI,MAAM,QAAwB;AAAA;AAAA,aAE7B;AAAA,EACT;AACA,KAAG,4CAA4C,YAAY;AACvD,UAAM,KAAK,MAAM,QAAwB;AAAA;AAAA,SAExC;AACD,UAAM,eAAe,EAAE;AACvB,UAAM,OAAO,EAAE,EAAE,GAAG,GAAG,WAAW;AAAA,EACtC,CAAC;AACL,CAAC;",
6
+ "names": []
7
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ import { Default } from "../stories/coachmark.stories.js";
3
+ import { testForMemoryLeaks } from "../../../test/testing-helpers.js";
4
+ testForMemoryLeaks(Default());
5
+ //# sourceMappingURL=coach-mark-memory.test.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["coach-mark-memory.test.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2023 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport { Default } from '../stories/coachmark.stories.js';\nimport { testForMemoryLeaks } from '../../../test/testing-helpers.js';\n\ntestForMemoryLeaks(Default());\n"],
5
+ "mappings": ";AAWA,SAAS,eAAe;AACxB,SAAS,0BAA0B;AAEnC,mBAAmB,QAAQ,CAAC;",
6
+ "names": []
7
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ import * as stories from "../stories/coachmark.stories.js";
3
+ import { regressVisuals } from "../../../test/visual/test.js";
4
+ regressVisuals("CoachmarkStories", stories);
5
+ //# sourceMappingURL=coachmark.test-vrt.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["coachmark.test-vrt.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport * as stories from '../stories/coachmark.stories.js';\nimport { regressVisuals } from '../../../test/visual/test.js';\nimport type { TestsType } from '../../../test/visual/test.js';\n\nregressVisuals('CoachmarkStories', stories as unknown as TestsType);\n"],
5
+ "mappings": ";AAYA,YAAY,aAAa;AACzB,SAAS,sBAAsB;AAG/B,eAAe,oBAAoB,OAA+B;",
6
+ "names": []
7
+ }
@@ -0,0 +1,211 @@
1
+ "use strict";
2
+ import {
3
+ elementUpdated,
4
+ expect,
5
+ fixture,
6
+ html,
7
+ nextFrame
8
+ } from "@open-wc/testing";
9
+ import { testForLitDevWarnings } from "../../../test/testing-helpers.js";
10
+ import "@spectrum-web-components/coachmark/sp-coachmark.js";
11
+ import "@spectrum-web-components/coachmark/sp-coach-indicator.js";
12
+ import "@spectrum-web-components/overlay/sp-overlay.js";
13
+ import { spy } from "sinon";
14
+ import {
15
+ Default,
16
+ InTour,
17
+ single,
18
+ withImage,
19
+ withKeys,
20
+ withShortCut
21
+ } from "../stories/coachmark.stories.js";
22
+ const defaultItem = {
23
+ heading: "I am the heading for Coachmark",
24
+ content: "I am the content for this Coachmark"
25
+ };
26
+ describe("Coachmark", () => {
27
+ testForLitDevWarnings(
28
+ async () => await fixture(
29
+ html`
30
+ <sp-coachmark
31
+ id="coachmark"
32
+ .content=${{
33
+ title: defaultItem.heading,
34
+ description: defaultItem.content
35
+ }}
36
+ ></sp-coachmark>
37
+ `
38
+ )
39
+ );
40
+ it("loads default coachmark accessibly", async () => {
41
+ const el = await fixture(Default());
42
+ await elementUpdated(el);
43
+ await expect(el).to.be.accessible();
44
+ });
45
+ it("displays the slotted content as `.title`", async () => {
46
+ const testHeading = "Coachmark with Text Only";
47
+ const el = await fixture(Default());
48
+ await elementUpdated(el);
49
+ const root = el.shadowRoot ? el.shadowRoot : el;
50
+ const headingSlot = root.querySelector(
51
+ '[name="title"]'
52
+ );
53
+ expect(headingSlot, "did not find slot element").to.not.be.null;
54
+ const nodes = headingSlot.assignedNodes();
55
+ const divElement = nodes.find(
56
+ (node) => node.id === "heading"
57
+ );
58
+ expect(divElement, "did not find div element").to.not.be.null;
59
+ expect(divElement.textContent).to.contain(
60
+ testHeading,
61
+ "the slotted content renders in the element"
62
+ );
63
+ });
64
+ it("if in tour coachmark loads with pagination with previous, next buttons and action menu", async () => {
65
+ var _a, _b, _c;
66
+ const el = await fixture(
67
+ InTour(
68
+ {
69
+ open: true,
70
+ heading: "Coachmark In Tour",
71
+ content: "This is a Coachmark with nothing but text in it."
72
+ },
73
+ {}
74
+ )
75
+ );
76
+ await elementUpdated(el);
77
+ await nextFrame();
78
+ await nextFrame();
79
+ const stepCount = el.shadowRoot.querySelector(
80
+ 'span[aria-live="polite"]'
81
+ );
82
+ const stepCountSlot = el.querySelector(
83
+ '[slot="step-count"]'
84
+ );
85
+ expect((_a = stepCountSlot == null ? void 0 : stepCountSlot.textContent) == null ? void 0 : _a.trim()).to.equal("2 of 8");
86
+ expect(stepCount == null ? void 0 : stepCount.textContent);
87
+ const nextButton = el.shadowRoot.querySelector(
88
+ 'sp-button[variant="primary"'
89
+ );
90
+ expect(nextButton).to.not.be.undefined;
91
+ expect((_b = nextButton == null ? void 0 : nextButton.textContent) == null ? void 0 : _b.trim()).to.equal("Next");
92
+ const prevButton = el.shadowRoot.querySelector(
93
+ 'sp-button[variant="secondary"'
94
+ );
95
+ expect(prevButton).to.not.be.undefined;
96
+ expect((_c = prevButton == null ? void 0 : prevButton.textContent) == null ? void 0 : _c.trim()).to.equal("Previous");
97
+ });
98
+ it("loads pagination when total step count is greater than 1", async () => {
99
+ var _a;
100
+ const el = await fixture(
101
+ InTour(
102
+ {
103
+ open: true,
104
+ heading: "Coachmark In Tour",
105
+ content: "This is a Coachmark with nothing but text in it.",
106
+ currentStep: 2,
107
+ totalSteps: 8
108
+ },
109
+ {}
110
+ )
111
+ );
112
+ await elementUpdated(el);
113
+ const stepCountSlot = el.querySelector(
114
+ '[slot="step-count"]'
115
+ );
116
+ expect((_a = stepCountSlot == null ? void 0 : stepCountSlot.textContent) == null ? void 0 : _a.trim()).to.equal("2 of 8");
117
+ await expect(el).to.be.accessible();
118
+ });
119
+ it('loads primary button with text "Ok" for a single coachmark', async () => {
120
+ var _a;
121
+ const el = await fixture(single());
122
+ await elementUpdated(el);
123
+ const okayButton = el.shadowRoot.querySelector(
124
+ 'sp-button[variant="primary"'
125
+ );
126
+ expect(okayButton).to.not.be.null;
127
+ expect((_a = okayButton == null ? void 0 : okayButton.textContent) == null ? void 0 : _a.trim()).to.equal("Ok");
128
+ });
129
+ it("renders modifier keys with joiner", async () => {
130
+ var _a, _b;
131
+ const modifierKeys = ["\u21E7 Shift", "\u2318"];
132
+ const el = await fixture(
133
+ withKeys({
134
+ modifierKeys,
135
+ heading: "Coachmark with Keys",
136
+ content: "This is a Coachmark with nothing but text in it."
137
+ })
138
+ );
139
+ await elementUpdated(el);
140
+ const modifier = el.shadowRoot.querySelector('span[type="modifier"]');
141
+ expect(modifier).to.not.be.undefined;
142
+ expect((_a = modifier == null ? void 0 : modifier.textContent) == null ? void 0 : _a.trim()).to.include("\u21E7 Shift");
143
+ const joiner = el.shadowRoot.querySelector('span[class="plus"]');
144
+ expect(joiner).to.not.be.undefined;
145
+ expect((_b = joiner == null ? void 0 : joiner.textContent) == null ? void 0 : _b.trim()).to.include("+");
146
+ });
147
+ it("renders with shortcut", async () => {
148
+ var _a;
149
+ const el = await fixture(
150
+ withShortCut({
151
+ currentStep: 1,
152
+ totalSteps: 8
153
+ })
154
+ );
155
+ await elementUpdated(el);
156
+ const shortcutKey = el.shadowRoot.querySelector(
157
+ 'span[type="shortcut"]'
158
+ );
159
+ expect(shortcutKey).to.not.be.undefined;
160
+ expect((_a = shortcutKey == null ? void 0 : shortcutKey.textContent) == null ? void 0 : _a.trim()).to.include("Z");
161
+ });
162
+ it("renders content with image asset", async () => {
163
+ const el = await fixture(
164
+ withImage({
165
+ currentStep: 1,
166
+ totalSteps: 8
167
+ })
168
+ );
169
+ await elementUpdated(el);
170
+ const imageElement = el.shadowRoot.querySelector(
171
+ 'img[src="https://picsum.photos/id/237/200/300"'
172
+ );
173
+ expect(imageElement).not.to.be.undefined;
174
+ });
175
+ it("in tour dispatches `primary` and `secondary`", async () => {
176
+ const primarySpy = spy();
177
+ const secondarySpy = spy();
178
+ const handlePrimary = () => primarySpy();
179
+ const handleSecondary = () => secondarySpy();
180
+ const el = await fixture(
181
+ InTour(
182
+ {
183
+ open: true,
184
+ heading: "Coachmark in Tour",
185
+ content: "This is a Coachmark with nothing but text in it."
186
+ },
187
+ {}
188
+ )
189
+ );
190
+ el.addEventListener("primary", handlePrimary);
191
+ el.addEventListener("secondary", handleSecondary);
192
+ await elementUpdated(el);
193
+ expect(primarySpy.called).to.be.false;
194
+ expect(secondarySpy.called).to.be.false;
195
+ const primaryButton = el.shadowRoot.querySelector(
196
+ '[variant="primary"]'
197
+ );
198
+ const secondaryButton = el.shadowRoot.querySelector(
199
+ '[variant="secondary"]'
200
+ );
201
+ primaryButton.click();
202
+ await elementUpdated(el);
203
+ expect(primarySpy.called, "dispatched `primary`").to.be.true;
204
+ expect(secondarySpy.called).to.be.false;
205
+ secondaryButton.click();
206
+ await elementUpdated(el);
207
+ expect(primarySpy.callCount).to.equal(1);
208
+ expect(secondarySpy.called, "dispatched `secondary`").to.be.true;
209
+ });
210
+ });
211
+ //# sourceMappingURL=coachmark.test.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["coachmark.test.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport {\n elementUpdated,\n expect,\n fixture,\n html,\n nextFrame,\n} from '@open-wc/testing';\n\nimport { Coachmark, CoachmarkItem } from '@spectrum-web-components/coachmark';\nimport { testForLitDevWarnings } from '../../../test/testing-helpers.js';\nimport '@spectrum-web-components/coachmark/sp-coachmark.js';\nimport '@spectrum-web-components/coachmark/sp-coach-indicator.js';\nimport '@spectrum-web-components/overlay/sp-overlay.js';\nimport { spy } from 'sinon';\nimport { Button } from '@spectrum-web-components/button';\nimport {\n Default,\n InTour,\n single,\n withImage,\n withKeys,\n withShortCut,\n} from '../stories/coachmark.stories.js';\n\nconst defaultItem: CoachmarkItem = {\n heading: 'I am the heading for Coachmark',\n content: 'I am the content for this Coachmark',\n};\ndescribe('Coachmark', () => {\n testForLitDevWarnings(\n async () =>\n await fixture<Coachmark>(\n html`\n <sp-coachmark\n id=\"coachmark\"\n .content=${{\n title: defaultItem.heading,\n description: defaultItem.content,\n }}\n ></sp-coachmark>\n `\n )\n );\n it('loads default coachmark accessibly', async () => {\n const el = await fixture<Coachmark>(Default());\n await elementUpdated(el);\n await expect(el).to.be.accessible();\n });\n it('displays the slotted content as `.title`', async () => {\n const testHeading = 'Coachmark with Text Only';\n const el = await fixture<Coachmark>(Default());\n\n await elementUpdated(el);\n\n const root = el.shadowRoot ? el.shadowRoot : el;\n const headingSlot = root.querySelector(\n '[name=\"title\"]'\n ) as HTMLSlotElement;\n\n expect(headingSlot, 'did not find slot element').to.not.be.null;\n const nodes = headingSlot.assignedNodes();\n const divElement = nodes.find(\n (node) => (node as HTMLElement).id === 'heading'\n );\n expect(divElement, 'did not find div element').to.not.be.null;\n expect((divElement as HTMLDivElement).textContent).to.contain(\n testHeading,\n 'the slotted content renders in the element'\n );\n });\n it('if in tour coachmark loads with pagination with previous, next buttons and action menu', async () => {\n const el = await fixture<Coachmark>(\n InTour(\n {\n open: true,\n heading: 'Coachmark In Tour',\n content: 'This is a Coachmark with nothing but text in it.',\n },\n {}\n )\n );\n await elementUpdated(el);\n await nextFrame();\n await nextFrame();\n\n const stepCount = el.shadowRoot.querySelector(\n 'span[aria-live=\"polite\"]'\n );\n\n const stepCountSlot = el.querySelector(\n '[slot=\"step-count\"]'\n ) as HTMLSlotElement;\n expect(stepCountSlot?.textContent?.trim()).to.equal('2 of 8');\n\n expect(stepCount?.textContent);\n const nextButton = el.shadowRoot.querySelector(\n 'sp-button[variant=\"primary\"'\n );\n expect(nextButton).to.not.be.undefined;\n expect(nextButton?.textContent?.trim()).to.equal('Next');\n\n const prevButton = el.shadowRoot.querySelector(\n 'sp-button[variant=\"secondary\"'\n );\n expect(prevButton).to.not.be.undefined;\n expect(prevButton?.textContent?.trim()).to.equal('Previous');\n });\n it('loads pagination when total step count is greater than 1', async () => {\n const el = await fixture<Coachmark>(\n InTour(\n {\n open: true,\n heading: 'Coachmark In Tour',\n content: 'This is a Coachmark with nothing but text in it.',\n currentStep: 2,\n totalSteps: 8,\n },\n {}\n )\n );\n await elementUpdated(el);\n const stepCountSlot = el.querySelector(\n '[slot=\"step-count\"]'\n ) as HTMLSlotElement;\n expect(stepCountSlot?.textContent?.trim()).to.equal('2 of 8');\n\n await expect(el).to.be.accessible();\n });\n it('loads primary button with text \"Ok\" for a single coachmark', async () => {\n const el = await fixture<Coachmark>(single());\n\n await elementUpdated(el);\n const okayButton = el.shadowRoot.querySelector(\n 'sp-button[variant=\"primary\"'\n );\n expect(okayButton).to.not.be.null;\n expect(okayButton?.textContent?.trim()).to.equal('Ok');\n });\n it('renders modifier keys with joiner', async () => {\n const modifierKeys = ['\u21E7 Shift', '\u2318'];\n const el = await fixture<Coachmark>(\n withKeys({\n modifierKeys,\n heading: 'Coachmark with Keys',\n content: 'This is a Coachmark with nothing but text in it.',\n })\n );\n await elementUpdated(el);\n const modifier = el.shadowRoot.querySelector('span[type=\"modifier\"]');\n expect(modifier).to.not.be.undefined;\n expect(modifier?.textContent?.trim()).to.include('\u21E7 Shift');\n const joiner = el.shadowRoot.querySelector('span[class=\"plus\"]');\n expect(joiner).to.not.be.undefined;\n expect(joiner?.textContent?.trim()).to.include('+');\n });\n it('renders with shortcut', async () => {\n const el = await fixture<Coachmark>(\n withShortCut({\n currentStep: 1,\n totalSteps: 8,\n })\n );\n await elementUpdated(el);\n\n const shortcutKey = el.shadowRoot.querySelector(\n 'span[type=\"shortcut\"]'\n );\n expect(shortcutKey).to.not.be.undefined;\n expect(shortcutKey?.textContent?.trim()).to.include('Z');\n });\n it('renders content with image asset', async () => {\n const el = await fixture<Coachmark>(\n withImage({\n currentStep: 1,\n totalSteps: 8,\n })\n );\n await elementUpdated(el);\n const imageElement = el.shadowRoot.querySelector(\n 'img[src=\"https://picsum.photos/id/237/200/300\"'\n );\n expect(imageElement).not.to.be.undefined;\n });\n it('in tour dispatches `primary` and `secondary`', async () => {\n const primarySpy = spy();\n const secondarySpy = spy();\n const handlePrimary = (): void => primarySpy();\n const handleSecondary = (): void => secondarySpy();\n const el = await fixture<Coachmark>(\n InTour(\n {\n open: true,\n heading: 'Coachmark in Tour',\n content: 'This is a Coachmark with nothing but text in it.',\n },\n {}\n )\n );\n el.addEventListener('primary', handlePrimary);\n el.addEventListener('secondary', handleSecondary);\n\n await elementUpdated(el);\n expect(primarySpy.called).to.be.false;\n expect(secondarySpy.called).to.be.false;\n\n const primaryButton = el.shadowRoot.querySelector(\n '[variant=\"primary\"]'\n ) as Button;\n const secondaryButton = el.shadowRoot.querySelector(\n '[variant=\"secondary\"]'\n ) as Button;\n primaryButton.click();\n\n await elementUpdated(el);\n expect(primarySpy.called, 'dispatched `primary`').to.be.true;\n expect(secondarySpy.called).to.be.false;\n\n secondaryButton.click();\n\n await elementUpdated(el);\n expect(primarySpy.callCount).to.equal(1);\n expect(secondarySpy.called, 'dispatched `secondary`').to.be.true;\n });\n});\n"],
5
+ "mappings": ";AAYA;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACG;AAGP,SAAS,6BAA6B;AACtC,OAAO;AACP,OAAO;AACP,OAAO;AACP,SAAS,WAAW;AAEpB;AAAA,EACI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACG;AAEP,MAAM,cAA6B;AAAA,EAC/B,SAAS;AAAA,EACT,SAAS;AACb;AACA,SAAS,aAAa,MAAM;AACxB;AAAA,IACI,YACI,MAAM;AAAA,MACF;AAAA;AAAA;AAAA,mCAGmB;AAAA,QACP,OAAO,YAAY;AAAA,QACnB,aAAa,YAAY;AAAA,MAC7B,CAAC;AAAA;AAAA;AAAA,IAGb;AAAA,EACR;AACA,KAAG,sCAAsC,YAAY;AACjD,UAAM,KAAK,MAAM,QAAmB,QAAQ,CAAC;AAC7C,UA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