@salesforcedevs/dx-components 0.21.0 → 0.23.0-alpha.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.
- package/lwc.config.json +2 -0
- package/package.json +2 -3
- package/src/.DS_Store +0 -0
- package/src/modules/.DS_Store +0 -0
- package/src/modules/dx/.DS_Store +0 -0
- package/src/modules/dx/cardExpanded/__tests__/cardExpanded.test.ts +193 -0
- package/src/modules/dx/cardExpanded/__tests__/mockProps.ts +21 -0
- package/src/modules/dx/cardExpanded/cardExpanded.css +49 -0
- package/src/modules/dx/cardExpanded/cardExpanded.html +37 -0
- package/src/modules/dx/cardExpanded/cardExpanded.stories.ts +59 -0
- package/src/modules/dx/cardExpanded/cardExpanded.ts +45 -0
- package/src/modules/dx/cardMinimal/__tests__/cardMinimal.test.ts +87 -0
- package/src/modules/dx/cardMinimal/__tests__/mockProps.ts +10 -0
- package/src/modules/dx/cardMinimal/cardMinimal.css +31 -0
- package/src/modules/dx/cardMinimal/cardMinimal.html +13 -0
- package/src/modules/dx/cardMinimal/cardMinimal.stories.ts +32 -0
- package/src/modules/dx/cardMinimal/cardMinimal.ts +3 -0
- package/src/modules/dx/codeBlock/__tests__/codeBlock.test.ts +0 -4
- package/src/modules/dx/grid/__tests__/grid.test.ts +2 -7
- package/src/modules/dx/headerSearch/__tests__/headerSearch.test.ts +0 -1
- package/src/modules/dx/imageAndLabel/imageAndLabel.html +14 -2
- package/src/modules/dx/popover/__tests__/popover.test.ts +26 -37
- package/src/modules/dx/sidebar/__tests__/sidebar.test.ts +0 -4
- package/src/modules/dx/sidebar/sidebar.ts +1 -0
- package/src/modules/dx/sidebarOld/__tests__/sidebarOld.test.ts +0 -4
- package/src/modules/dx/sidebarSearch/sidebarSearch.html +2 -2
- package/src/modules/dx/sidebarSearch/sidebarSearch.ts +1 -0
- package/src/modules/dx/socials/__tests__/socials.test.ts +12 -22
- package/src/modules/dx/topics/__tests__/mockProps.ts +3 -0
- package/src/modules/dx/topics/__tests__/topics.test.ts +31 -0
- package/src/modules/dx/topics/topics.css +25 -0
- package/src/modules/dx/topics/topics.html +12 -0
- package/src/modules/dx/topics/topics.ts +25 -0
- package/src/modules/dx/tree/__tests__/tree.test.ts +17 -28
- package/src/modules/dx/treeItem/__tests__/treeItem.test.ts +36 -59
- package/src/modules/dx/typeBadge/typeBadge.css +1 -1
- package/src/modules/helpers/text/text.css +7 -0
- package/src/modules/utils/archiveCard/archiveCard.ts +35 -0
- package/src/modules/utils/normalizers/normalizers.ts +2 -2
- package/LICENSE +0 -12
|
@@ -1,10 +1,22 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div if:false={href} class="container">
|
|
3
|
-
<img
|
|
3
|
+
<img
|
|
4
|
+
if:true={imgSrc}
|
|
5
|
+
class={imgClass}
|
|
6
|
+
src={imgSrc}
|
|
7
|
+
alt={imgAlt}
|
|
8
|
+
part="image"
|
|
9
|
+
/>
|
|
4
10
|
<span class="dx-text-label-1-dark" part="label">{label}</span>
|
|
5
11
|
</div>
|
|
6
12
|
<a if:true={href} href={href} class="container">
|
|
7
|
-
<img
|
|
13
|
+
<img
|
|
14
|
+
if:true={imgSrc}
|
|
15
|
+
class={imgClass}
|
|
16
|
+
src={imgSrc}
|
|
17
|
+
alt={imgAlt}
|
|
18
|
+
part="image"
|
|
19
|
+
/>
|
|
8
20
|
<span class="dx-text-label-1-dark" part="label">{label}</span>
|
|
9
21
|
</a>
|
|
10
22
|
</template>
|
|
@@ -16,10 +16,6 @@ describe(TAG, () => {
|
|
|
16
16
|
global.console = { ...global.console, error: jest.fn() };
|
|
17
17
|
});
|
|
18
18
|
|
|
19
|
-
afterEach(() => {
|
|
20
|
-
jest.clearAllMocks();
|
|
21
|
-
});
|
|
22
|
-
|
|
23
19
|
afterAll(() => {
|
|
24
20
|
global.console = originalConsole;
|
|
25
21
|
});
|
|
@@ -29,15 +25,13 @@ describe(TAG, () => {
|
|
|
29
25
|
|
|
30
26
|
expect(console.error).not.toBeCalled();
|
|
31
27
|
|
|
32
|
-
const menuEl: HTMLElement =
|
|
33
|
-
".popover-container"
|
|
34
|
-
);
|
|
28
|
+
const menuEl: HTMLElement =
|
|
29
|
+
component.shadowRoot.querySelector(".popover-container");
|
|
35
30
|
expect(menuEl).not.toBeNull();
|
|
36
31
|
expect(menuEl.classList).toHaveLength(1);
|
|
37
32
|
|
|
38
|
-
const popoverDiv: HTMLElement =
|
|
39
|
-
"div.popover"
|
|
40
|
-
)!;
|
|
33
|
+
const popoverDiv: HTMLElement =
|
|
34
|
+
menuEl.querySelector("div.popover")!;
|
|
41
35
|
expect(popoverDiv).not.toBeNull();
|
|
42
36
|
expect(popoverDiv.classList).toHaveLength(1);
|
|
43
37
|
|
|
@@ -47,15 +41,13 @@ describe(TAG, () => {
|
|
|
47
41
|
it("renders with api properties", () => {
|
|
48
42
|
const component = render(mockProps);
|
|
49
43
|
expect(console.error).not.toBeCalled();
|
|
50
|
-
const menuEl: HTMLElement =
|
|
51
|
-
".popover-container"
|
|
52
|
-
);
|
|
44
|
+
const menuEl: HTMLElement =
|
|
45
|
+
component.shadowRoot.querySelector(".popover-container");
|
|
53
46
|
expect(menuEl).not.toBeNull();
|
|
54
47
|
expect(menuEl.classList).toHaveLength(1);
|
|
55
48
|
|
|
56
|
-
const popoverDiv: HTMLElement =
|
|
57
|
-
"div.popover"
|
|
58
|
-
)!;
|
|
49
|
+
const popoverDiv: HTMLElement =
|
|
50
|
+
menuEl.querySelector("div.popover")!;
|
|
59
51
|
expect(popoverDiv).not.toBeNull();
|
|
60
52
|
expect(popoverDiv.classList).toHaveLength(4);
|
|
61
53
|
expect(popoverDiv.classList).toContain(
|
|
@@ -74,9 +66,8 @@ describe(TAG, () => {
|
|
|
74
66
|
|
|
75
67
|
expect(console.error).not.toBeCalled();
|
|
76
68
|
|
|
77
|
-
const popoverDiv: HTMLElement =
|
|
78
|
-
"div.popover"
|
|
79
|
-
);
|
|
69
|
+
const popoverDiv: HTMLElement =
|
|
70
|
+
component.shadowRoot.querySelector("div.popover");
|
|
80
71
|
expect(popoverDiv.classList).toHaveLength(2);
|
|
81
72
|
expect(popoverDiv.classList).toContain("popover-fullwidth");
|
|
82
73
|
});
|
|
@@ -89,9 +80,8 @@ describe(TAG, () => {
|
|
|
89
80
|
'The "width" and "full-width" properties cannot be provided simultaneously.'
|
|
90
81
|
);
|
|
91
82
|
|
|
92
|
-
const popoverDiv: HTMLElement =
|
|
93
|
-
"div.popover"
|
|
94
|
-
);
|
|
83
|
+
const popoverDiv: HTMLElement =
|
|
84
|
+
component.shadowRoot.querySelector("div.popover");
|
|
95
85
|
expect(popoverDiv.style).not.toBeNull();
|
|
96
86
|
expect(popoverDiv.classList).toHaveLength(5);
|
|
97
87
|
expect(popoverDiv.classList).toContain(
|
|
@@ -120,9 +110,8 @@ describe(TAG, () => {
|
|
|
120
110
|
|
|
121
111
|
it("doesn't render menu content before interaction", async () => {
|
|
122
112
|
const component = render();
|
|
123
|
-
const content =
|
|
124
|
-
".popover-content"
|
|
125
|
-
);
|
|
113
|
+
const content =
|
|
114
|
+
component.shadowRoot.querySelector(".popover-content");
|
|
126
115
|
|
|
127
116
|
expect(content).toBeNull();
|
|
128
117
|
|
|
@@ -130,9 +119,8 @@ describe(TAG, () => {
|
|
|
130
119
|
|
|
131
120
|
await Promise.resolve();
|
|
132
121
|
|
|
133
|
-
const contentAfterOpen =
|
|
134
|
-
".popover-content"
|
|
135
|
-
);
|
|
122
|
+
const contentAfterOpen =
|
|
123
|
+
component.shadowRoot.querySelector(".popover-content");
|
|
136
124
|
|
|
137
125
|
expect(contentAfterOpen).not.toBeNull();
|
|
138
126
|
|
|
@@ -145,9 +133,8 @@ describe(TAG, () => {
|
|
|
145
133
|
|
|
146
134
|
const renderComponent = createRenderComponent(TAG, Popover);
|
|
147
135
|
const component = renderComponent();
|
|
148
|
-
const content =
|
|
149
|
-
".popover-content"
|
|
150
|
-
);
|
|
136
|
+
const content =
|
|
137
|
+
component.shadowRoot.querySelector(".popover-content");
|
|
151
138
|
|
|
152
139
|
expect(content).not.toBeNull();
|
|
153
140
|
});
|
|
@@ -183,9 +170,12 @@ describe(TAG, () => {
|
|
|
183
170
|
it("doesn't fire open if passed control is disabled", () => {
|
|
184
171
|
const element = render();
|
|
185
172
|
|
|
186
|
-
const { slot: controlSlot, slottedElement } =
|
|
187
|
-
HTMLButtonElement
|
|
188
|
-
|
|
173
|
+
const { slot: controlSlot, slottedElement } =
|
|
174
|
+
mockSlottedElement<HTMLButtonElement>(
|
|
175
|
+
element,
|
|
176
|
+
"button",
|
|
177
|
+
"control"
|
|
178
|
+
);
|
|
189
179
|
expect(controlSlot.assignedElements).toBeCalledTimes(1);
|
|
190
180
|
expect(slottedElement.ariaHasPopup).toBe("true");
|
|
191
181
|
expect(slottedElement.style.cursor).toBe("cursor");
|
|
@@ -237,9 +227,8 @@ describe(TAG, () => {
|
|
|
237
227
|
const closeEvent = jest.fn();
|
|
238
228
|
component.addEventListener("close", closeEvent);
|
|
239
229
|
|
|
240
|
-
const popoverDiv: HTMLElement =
|
|
241
|
-
".popover"
|
|
242
|
-
);
|
|
230
|
+
const popoverDiv: HTMLElement =
|
|
231
|
+
component.shadowRoot.querySelector(".popover");
|
|
243
232
|
expect(popoverDiv).not.toBeNull();
|
|
244
233
|
|
|
245
234
|
expect(component.open).toBe(true);
|
|
@@ -25,10 +25,6 @@ const GTM_EVENT_NAME = "custEv_leftNavLinkClick";
|
|
|
25
25
|
const TOGGLE_BUTTON_LABEL = "Toggle Sidebar";
|
|
26
26
|
|
|
27
27
|
describe(TAG, () => {
|
|
28
|
-
afterEach(() => {
|
|
29
|
-
jest.clearAllMocks();
|
|
30
|
-
});
|
|
31
|
-
|
|
32
28
|
describe("desktop", () => {
|
|
33
29
|
beforeEach(() => {
|
|
34
30
|
unmockQueryParameter();
|
|
@@ -19,10 +19,6 @@ const GTM_EVENT_NAME = "custEv_leftNavLinkClick";
|
|
|
19
19
|
const TOGGLE_BUTTON_LABEL = "Toggle Sidebar";
|
|
20
20
|
|
|
21
21
|
describe(TAG, () => {
|
|
22
|
-
afterEach(() => {
|
|
23
|
-
jest.clearAllMocks();
|
|
24
|
-
});
|
|
25
|
-
|
|
26
22
|
describe("desktop", () => {
|
|
27
23
|
describe("component render", () => {
|
|
28
24
|
it("should render as expanded with all the elements that sidebar includes", () => {
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
<dx-input
|
|
11
11
|
class="search-box"
|
|
12
12
|
type="search"
|
|
13
|
-
placeholder="Search
|
|
13
|
+
placeholder="Search"
|
|
14
14
|
role="search"
|
|
15
|
-
aria-label="
|
|
15
|
+
aria-label="Search in this guide"
|
|
16
16
|
icon-symbol="search"
|
|
17
17
|
size="small"
|
|
18
18
|
value={value}
|
|
@@ -53,6 +53,7 @@ export default class SidebarSearch extends LightningElement {
|
|
|
53
53
|
|
|
54
54
|
if (hasChanged && this.engine) {
|
|
55
55
|
// set advanced filters needs access to the latest coveoAdvancedQueryConfig
|
|
56
|
+
console.log('dispatching in the query change')
|
|
56
57
|
this.dispatchOnLoading(true);
|
|
57
58
|
this.setAdvancedFilters(this.engine);
|
|
58
59
|
this.submitSearch(true);
|
|
@@ -14,10 +14,6 @@ describe(TAG, () => {
|
|
|
14
14
|
global.console = { ...global.console, error: jest.fn() };
|
|
15
15
|
});
|
|
16
16
|
|
|
17
|
-
afterEach(() => {
|
|
18
|
-
jest.clearAllMocks();
|
|
19
|
-
});
|
|
20
|
-
|
|
21
17
|
afterAll(() => {
|
|
22
18
|
global.console = originalConsole;
|
|
23
19
|
});
|
|
@@ -25,9 +21,8 @@ describe(TAG, () => {
|
|
|
25
21
|
it("renders dx-icon-badge for each social link", () => {
|
|
26
22
|
const component = render();
|
|
27
23
|
|
|
28
|
-
const links: Array<HTMLAnchorElement> =
|
|
29
|
-
"a"
|
|
30
|
-
);
|
|
24
|
+
const links: Array<HTMLAnchorElement> =
|
|
25
|
+
component.shadowRoot.querySelectorAll("a");
|
|
31
26
|
expect(links).toHaveLength(3);
|
|
32
27
|
|
|
33
28
|
const [facebookLink, twitterLink, linkedinLink] = links;
|
|
@@ -50,9 +45,8 @@ describe(TAG, () => {
|
|
|
50
45
|
expect(linkedinLink.target).toBe("_blank");
|
|
51
46
|
expect(linkedinLink.title).toBe("Linkedin");
|
|
52
47
|
|
|
53
|
-
const iconBadge: Array<IconBadge> =
|
|
54
|
-
"dx-icon-badge"
|
|
55
|
-
);
|
|
48
|
+
const iconBadge: Array<IconBadge> =
|
|
49
|
+
component.shadowRoot.querySelectorAll("dx-icon-badge");
|
|
56
50
|
expect(iconBadge).toHaveLength(3);
|
|
57
51
|
|
|
58
52
|
const [facebookIcon, twitterIcon, linkedinIcon] = iconBadge;
|
|
@@ -66,9 +60,8 @@ describe(TAG, () => {
|
|
|
66
60
|
expect(linkedinIcon.sprite).toBe("brand");
|
|
67
61
|
expect(linkedinIcon.symbol).toBe("linkedin-in");
|
|
68
62
|
|
|
69
|
-
const detailSection =
|
|
70
|
-
".details-section"
|
|
71
|
-
);
|
|
63
|
+
const detailSection =
|
|
64
|
+
component.shadowRoot.querySelector(".details-section");
|
|
72
65
|
expect(detailSection).toBeNull();
|
|
73
66
|
|
|
74
67
|
return expect(component).toBeAccessible();
|
|
@@ -78,9 +71,8 @@ describe(TAG, () => {
|
|
|
78
71
|
const expectedTarget = "_self";
|
|
79
72
|
const component = render({ linksTarget: expectedTarget });
|
|
80
73
|
|
|
81
|
-
const links: Array<HTMLAnchorElement> =
|
|
82
|
-
"a"
|
|
83
|
-
);
|
|
74
|
+
const links: Array<HTMLAnchorElement> =
|
|
75
|
+
component.shadowRoot.querySelectorAll("a");
|
|
84
76
|
expect(links).toHaveLength(3);
|
|
85
77
|
links.forEach(({ target }) => expect(target).toBe(expectedTarget));
|
|
86
78
|
|
|
@@ -93,9 +85,8 @@ describe(TAG, () => {
|
|
|
93
85
|
const testTarget = "not_valid_at_all";
|
|
94
86
|
const component = render({ linksTarget: testTarget });
|
|
95
87
|
|
|
96
|
-
const links: Array<HTMLAnchorElement> =
|
|
97
|
-
"a"
|
|
98
|
-
);
|
|
88
|
+
const links: Array<HTMLAnchorElement> =
|
|
89
|
+
component.shadowRoot.querySelectorAll("a");
|
|
99
90
|
expect(links).toHaveLength(3);
|
|
100
91
|
links.forEach(({ target }) => expect(target).toBe("_blank"));
|
|
101
92
|
|
|
@@ -110,9 +101,8 @@ describe(TAG, () => {
|
|
|
110
101
|
it("renders details section", () => {
|
|
111
102
|
const component = render({ details: "Test|Another Test" });
|
|
112
103
|
|
|
113
|
-
const details: Array<HTMLElement> =
|
|
114
|
-
".details-section span"
|
|
115
|
-
);
|
|
104
|
+
const details: Array<HTMLElement> =
|
|
105
|
+
component.shadowRoot.querySelectorAll(".details-section span");
|
|
116
106
|
expect(details).toHaveLength(2);
|
|
117
107
|
|
|
118
108
|
const [testDetail, anotherTestDetail] = details;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import Topics from "dx/topics";
|
|
2
|
+
import { createRenderComponent } from "utils/tests";
|
|
3
|
+
import mockProps from "./mockProps";
|
|
4
|
+
|
|
5
|
+
const TAG = "dx-topics";
|
|
6
|
+
const render = createRenderComponent(TAG, Topics);
|
|
7
|
+
describe(TAG, () => {
|
|
8
|
+
it("renders", () => {
|
|
9
|
+
const component = render(mockProps);
|
|
10
|
+
expect(component.topics).toEqual(mockProps.topics);
|
|
11
|
+
|
|
12
|
+
const spans: Array<HTMLElement> =
|
|
13
|
+
component.shadowRoot.querySelectorAll("span");
|
|
14
|
+
expect(spans).toHaveLength(3);
|
|
15
|
+
|
|
16
|
+
const [expectedFirst, expectedSecond] = mockProps.topics;
|
|
17
|
+
const [first, dot, second] = spans;
|
|
18
|
+
expect(first.textContent).toBe(expectedFirst);
|
|
19
|
+
expect(second.textContent).toBe(expectedSecond);
|
|
20
|
+
expect(dot.classList).toContain("dot-separator");
|
|
21
|
+
|
|
22
|
+
return expect(component).toBeAccessible();
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it("doesn't render any span if list is empty", () => {
|
|
26
|
+
const component = render();
|
|
27
|
+
const spans: Array<HTMLElement> =
|
|
28
|
+
component.shadowRoot.querySelectorAll("span");
|
|
29
|
+
expect(spans).toHaveLength(0);
|
|
30
|
+
});
|
|
31
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: block;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.container {
|
|
6
|
+
align-items: center;
|
|
7
|
+
color: var(--dx-g-blue-vibrant-20);
|
|
8
|
+
font-size: var(--dx-g-text-xs);
|
|
9
|
+
font-family: var(--dx-g-font-display);
|
|
10
|
+
font-weight: var(--dx-g-font-demi);
|
|
11
|
+
display: flex;
|
|
12
|
+
gap: var(--dx-g-spacing-sm);
|
|
13
|
+
letter-spacing: 1px;
|
|
14
|
+
text-transform: uppercase;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.dot-separator {
|
|
18
|
+
--size: 4px;
|
|
19
|
+
|
|
20
|
+
height: var(--size);
|
|
21
|
+
width: var(--size);
|
|
22
|
+
background-color: var(--dx-g-blue-vibrant-20);
|
|
23
|
+
border-radius: 100%;
|
|
24
|
+
margin-bottom: 3px;
|
|
25
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="container dx-text-label-1-dark">
|
|
3
|
+
<template for:each={normalizedTopics} for:item="topic">
|
|
4
|
+
<span key={topic.id}>{topic.label}</span>
|
|
5
|
+
<span
|
|
6
|
+
key={topic.id}
|
|
7
|
+
if:false={topic.isLast}
|
|
8
|
+
class="dot-separator"
|
|
9
|
+
></span>
|
|
10
|
+
</template>
|
|
11
|
+
</div>
|
|
12
|
+
</template>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { LightningElement, api } from "lwc";
|
|
2
|
+
import { normalizeToArray } from "utils/normalizers";
|
|
3
|
+
|
|
4
|
+
export default class Topics extends LightningElement {
|
|
5
|
+
private _topics: Array<string> = [];
|
|
6
|
+
|
|
7
|
+
@api
|
|
8
|
+
get topics() {
|
|
9
|
+
return this._topics;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
set topics(value) {
|
|
13
|
+
this._topics = normalizeToArray(value);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
get normalizedTopics() {
|
|
17
|
+
const { length } = this._topics;
|
|
18
|
+
|
|
19
|
+
return this._topics?.map((topic, index) => ({
|
|
20
|
+
id: topic,
|
|
21
|
+
label: topic,
|
|
22
|
+
isLast: index === length - 1
|
|
23
|
+
}));
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -37,10 +37,6 @@ describe(TAG, () => {
|
|
|
37
37
|
mockInitialize.mockReturnValue(INITIALIZE_MOCK_RESULT);
|
|
38
38
|
});
|
|
39
39
|
|
|
40
|
-
afterEach(() => {
|
|
41
|
-
jest.clearAllMocks();
|
|
42
|
-
});
|
|
43
|
-
|
|
44
40
|
describe("component render", () => {
|
|
45
41
|
it("should render dx-tree-item with appropiate properties", () => {
|
|
46
42
|
const component = renderComponent({
|
|
@@ -49,9 +45,8 @@ describe(TAG, () => {
|
|
|
49
45
|
expect(component.treeRoot).toEqual(INITIALIZE_MOCK_RESULT);
|
|
50
46
|
expect(component.value).toBeUndefined();
|
|
51
47
|
|
|
52
|
-
const treeItem: TreeItem =
|
|
53
|
-
"dx-tree-item"
|
|
54
|
-
);
|
|
48
|
+
const treeItem: TreeItem =
|
|
49
|
+
component.shadowRoot.querySelector("dx-tree-item");
|
|
55
50
|
expect(treeItem).not.toBeNull();
|
|
56
51
|
expect(treeItem.treeNode).toEqual(INITIALIZE_MOCK_RESULT);
|
|
57
52
|
expect(treeItem.isRoot).toBe(true);
|
|
@@ -81,9 +76,8 @@ describe(TAG, () => {
|
|
|
81
76
|
expect(component.treeRoot).toEqual(INITIALIZE_MOCK_RESULT);
|
|
82
77
|
expect(component.value).toBe(INITIALIZE_MOCK_PARAMETER.name);
|
|
83
78
|
|
|
84
|
-
const treeItem: TreeItem =
|
|
85
|
-
"dx-tree-item"
|
|
86
|
-
);
|
|
79
|
+
const treeItem: TreeItem =
|
|
80
|
+
component.shadowRoot.querySelector("dx-tree-item");
|
|
87
81
|
expect(treeItem).not.toBeNull();
|
|
88
82
|
expect(treeItem.treeNode).toEqual(INITIALIZE_MOCK_RESULT);
|
|
89
83
|
expect(treeItem.isRoot).toBe(true);
|
|
@@ -122,9 +116,8 @@ describe(TAG, () => {
|
|
|
122
116
|
value: INITIALIZE_MOCK_PARAMETER.name
|
|
123
117
|
});
|
|
124
118
|
|
|
125
|
-
const treeItem: TreeItem =
|
|
126
|
-
"dx-tree-item"
|
|
127
|
-
);
|
|
119
|
+
const treeItem: TreeItem =
|
|
120
|
+
component.shadowRoot.querySelector("dx-tree-item");
|
|
128
121
|
expect(treeItem).not.toBeNull();
|
|
129
122
|
expect(treeItem.selectedKey).toBe(validKey);
|
|
130
123
|
|
|
@@ -183,9 +176,8 @@ describe(TAG, () => {
|
|
|
183
176
|
expect(mockGetNode).not.toBeCalled();
|
|
184
177
|
|
|
185
178
|
return Promise.resolve().then(() => {
|
|
186
|
-
const treeItem: TreeItem =
|
|
187
|
-
"dx-tree-item"
|
|
188
|
-
);
|
|
179
|
+
const treeItem: TreeItem =
|
|
180
|
+
component.shadowRoot.querySelector("dx-tree-item");
|
|
189
181
|
expect(treeItem).not.toBeNull();
|
|
190
182
|
expect(treeItem.selectedKey).toBe(expectedKey);
|
|
191
183
|
|
|
@@ -241,9 +233,8 @@ describe(TAG, () => {
|
|
|
241
233
|
const mockTileSelected = jest.fn();
|
|
242
234
|
component.addEventListener("tileselected", mockTileSelected);
|
|
243
235
|
|
|
244
|
-
const treeItem: TreeItem =
|
|
245
|
-
"dx-tree-item"
|
|
246
|
-
);
|
|
236
|
+
const treeItem: TreeItem =
|
|
237
|
+
component.shadowRoot.querySelector("dx-tree-item");
|
|
247
238
|
treeItem.dispatchEvent(
|
|
248
239
|
new CustomEvent("tileselected", MOCK_TILE_DETAIL)
|
|
249
240
|
);
|
|
@@ -339,15 +330,13 @@ describe(TAG, () => {
|
|
|
339
330
|
const mockRegister = jest.fn();
|
|
340
331
|
component.addEventListener("register", mockRegister);
|
|
341
332
|
|
|
342
|
-
component.shadowRoot
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
})
|
|
350
|
-
);
|
|
333
|
+
component.shadowRoot.querySelector("dx-tree-item").dispatchEvent(
|
|
334
|
+
new CustomEvent("register", {
|
|
335
|
+
detail,
|
|
336
|
+
bubbles: true,
|
|
337
|
+
composed: true
|
|
338
|
+
})
|
|
339
|
+
);
|
|
351
340
|
|
|
352
341
|
expect(mockRegisterSetExpanded).toBeCalledTimes(1);
|
|
353
342
|
expect(mockRegisterSetExpanded).toBeCalledWith(detail);
|