@salesforcedevs/dx-components 0.26.2 → 0.28.0
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 -1
- package/package.json +2 -6
- package/src/modules/{utils-internal → base-elements}/archiveCard/archiveCard.ts +0 -0
- package/src/modules/{utils-internal → base-elements}/headerBase/headerBase.ts +0 -0
- package/src/modules/dx/cardBlogPostProvider/cardBlogPostProvider.ts +1 -1
- package/src/modules/dx/cardCallout/cardCallout.ts +1 -1
- package/src/modules/dx/cardContent/cardContent.ts +2 -2
- package/src/modules/dx/cardDocs/cardDocs.ts +1 -1
- package/src/modules/dx/cardExpanded/cardExpanded.ts +1 -1
- package/src/modules/dx/cardMinimal/cardMinimal.ts +1 -1
- package/src/modules/dx/cardNews/cardNews.ts +1 -1
- package/src/modules/dx/cardPodcastEpisodeProvider/cardPodcastEpisodeProvider.ts +1 -1
- package/src/modules/dx/cardSmall/cardSmall.ts +1 -1
- package/src/modules/dx/codeBlock/codeBlock.ts +1 -1
- package/src/modules/dx/dropdown/dropdown.ts +1 -1
- package/src/modules/dx/featuredContentHeader/featuredContentHeader.ts +1 -1
- package/src/modules/dx/groupText/groupText.ts +1 -1
- package/src/modules/dx/header/header.ts +1 -1
- package/src/modules/dx/headerMobileNavMenu/headerMobileNavMenu.ts +1 -1
- package/src/modules/dx/headerSearch/headerSearch.ts +1 -1
- package/src/modules/dx/icon/icon.ts +1 -1
- package/src/modules/dx/iconBadge/iconBadge.ts +1 -1
- package/src/modules/dx/input/input.ts +1 -1
- package/src/modules/dx/modalDrawer/modalDrawer.css +40 -0
- package/src/modules/dx/modalDrawer/modalDrawer.html +11 -0
- package/src/modules/dx/modalDrawer/modalDrawer.ts +27 -0
- package/src/modules/dx/popover/popover.ts +1 -1
- package/src/modules/dx/section/section.ts +1 -1
- package/src/modules/dx/sidebar/sidebar.ts +1 -1
- package/src/modules/dx/sidebarSearch/sidebarSearch.ts +2 -5
- package/src/modules/dx/slackCta/slackCta.css +1 -1
- package/src/modules/dx/tooltip/tooltip.css +1 -0
- package/src/modules/dx/typeBadge/typeBadge.ts +1 -1
- package/src/modules/{utils-internal → utils}/coveo/coveo.ts +0 -0
- package/src/modules/{utils-internal → utils}/css/css.ts +0 -0
- package/src/modules/{utils-internal → utils}/devices/devices.ts +0 -0
- package/src/modules/utils/highlight/highlight.ts +1 -1
- package/src/modules/{utils-internal → utils}/options/options.ts +0 -0
- package/src/modules/{utils-internal → utils}/prismjs/prismjs.html +0 -0
- package/src/modules/{utils-internal → utils}/prismjs/prismjs.ts +0 -0
- package/src/modules/{utils-internal → utils}/recentSearches/recentSearches.ts +0 -0
- package/src/modules/{utils-internal → utils}/regexps/regexps.ts +0 -0
- package/src/modules/{utils-internal → utils}/seo/seo.ts +0 -0
- package/src/modules/{utils-internal → utils}/slot/slot.ts +0 -0
- package/src/modules/{utils-internal → utils}/wordpress/wordpress.ts +0 -0
- package/src/modules/dx/banner/__tests__/banner.test.ts +0 -33
- package/src/modules/dx/brandThemeProvider/__tests__/brandThemeProvider.test.ts +0 -49
- package/src/modules/dx/brandThemeProvider/brandThemeProvider.stories.ts +0 -321
- package/src/modules/dx/breadcrumbs/__tests__/breadcrumbs.test.ts +0 -140
- package/src/modules/dx/breadcrumbs/__tests__/mockProps.ts +0 -28
- package/src/modules/dx/breadcrumbs/breadcrumbs.stories.ts +0 -39
- package/src/modules/dx/button/__tests__/button.test.ts +0 -107
- package/src/modules/dx/button/button.stories.ts +0 -150
- package/src/modules/dx/cardBlogPost/__tests__/cardBlogPost.test.ts +0 -26
- package/src/modules/dx/cardBlogPost/__tests__/mockProps.ts +0 -12
- package/src/modules/dx/cardBlogPost/cardBlogPost.stories.ts +0 -164
- package/src/modules/dx/cardBlogPostProvider/__tests__/cardBlogPostProvider.test.ts +0 -34
- package/src/modules/dx/cardBlogPostProvider/__tests__/mockWordpressPosts.ts +0 -44
- package/src/modules/dx/cardCallout/__tests__/cardCallout.test.ts +0 -20
- package/src/modules/dx/cardCallout/__tests__/mockProps.ts +0 -7
- package/src/modules/dx/cardCallout/cardCallout.stories.ts +0 -33
- package/src/modules/dx/cardContent/__tests__/cardContent.test.ts +0 -100
- package/src/modules/dx/cardContent/__tests__/mockProps.ts +0 -13
- package/src/modules/dx/cardContent/cardContent.stories.ts +0 -127
- package/src/modules/dx/cardDemo/cardDemo.stories.ts +0 -115
- package/src/modules/dx/cardDocs/__tests__/cardDocs.test.ts +0 -48
- package/src/modules/dx/cardDocs/__tests__/mockProps.ts +0 -9
- package/src/modules/dx/cardDocs/cardDocs.stories.ts +0 -299
- package/src/modules/dx/cardEvent/__tests__/cardEvent.test.ts +0 -95
- package/src/modules/dx/cardEvent/__tests__/mockProps.ts +0 -10
- package/src/modules/dx/cardEvent/cardEvent.stories.ts +0 -153
- package/src/modules/dx/cardExpanded/__tests__/cardExpanded.test.ts +0 -193
- package/src/modules/dx/cardExpanded/__tests__/mockProps.ts +0 -21
- package/src/modules/dx/cardExpanded/cardExpanded.stories.ts +0 -59
- package/src/modules/dx/cardGrid/__tests__/cardMockProps.ts +0 -431
- package/src/modules/dx/cardGrid/__tests__/mockProps.ts +0 -15
- package/src/modules/dx/cardGrid/cardGrid.stories.ts +0 -111
- package/src/modules/dx/cardMinimal/__tests__/cardMinimal.test.ts +0 -87
- package/src/modules/dx/cardMinimal/__tests__/mockProps.ts +0 -10
- package/src/modules/dx/cardMinimal/cardMinimal.stories.ts +0 -32
- package/src/modules/dx/cardNews/__tests__/cardNews.test.ts +0 -58
- package/src/modules/dx/cardNews/__tests__/mockProps.ts +0 -7
- package/src/modules/dx/cardNews/cardNews.stories.ts +0 -115
- package/src/modules/dx/cardPodcastEpisode/__tests__/cardPodcastEpisode.test.ts +0 -68
- package/src/modules/dx/cardPodcastEpisode/cardPodcastEpisode.stories.ts +0 -31
- package/src/modules/dx/cardPodcastEpisodeProvider/__tests__/cardPodcastEpisodeProvider.test.ts +0 -36
- package/src/modules/dx/cardPodcastEpisodeProvider/__tests__/mockWordpressEpisodes.ts +0 -50
- package/src/modules/dx/cardSmall/__tests__/cardSmall.test.ts +0 -66
- package/src/modules/dx/cardSmall/__tests__/mockProps.ts +0 -8
- package/src/modules/dx/cardSmall/cardSmall.stories.ts +0 -166
- package/src/modules/dx/cardTitle/__tests__/cardTitle.test.ts +0 -46
- package/src/modules/dx/cardTrailheadModule/__tests__/cardTrailheadModule.test.ts +0 -18
- package/src/modules/dx/cardTrailheadModule/__tests__/mockProps.ts +0 -11
- package/src/modules/dx/cardTrailheadModule/cardTrailheadModule.stories.ts +0 -122
- package/src/modules/dx/cardVideoPreview/__tests__/cardVideoPreview.test.ts +0 -22
- package/src/modules/dx/cardVideoPreview/__tests__/mockProps.ts +0 -11
- package/src/modules/dx/cardVideoPreview/cardVideoPreview.stories.ts +0 -147
- package/src/modules/dx/checkbox/__tests__/checkbox.test.ts +0 -85
- package/src/modules/dx/checkbox/__tests__/mockProps.ts +0 -5
- package/src/modules/dx/checkbox/checkbox.stories.ts +0 -38
- package/src/modules/dx/checkboxGroup/__tests__/checkboxGroup.test.ts +0 -80
- package/src/modules/dx/checkboxGroup/__tests__/mockProps.ts +0 -14
- package/src/modules/dx/checkboxGroup/checkboxGroup.stories.ts +0 -33
- package/src/modules/dx/codeBlock/__tests__/codeBlock.test.ts +0 -238
- package/src/modules/dx/codeBlock/__tests__/mockProps.ts +0 -160
- package/src/modules/dx/codeBlock/codeBlock.stories.ts +0 -143
- package/src/modules/dx/dropdown/__tests__/dropdown.test.ts +0 -165
- package/src/modules/dx/dropdown/__tests__/mockNestedOptions.ts +0 -96
- package/src/modules/dx/dropdown/__tests__/mockOptions.ts +0 -10
- package/src/modules/dx/dropdown/__tests__/mockProps.ts +0 -6
- package/src/modules/dx/dropdown/dropdown.stories.ts +0 -89
- package/src/modules/dx/dropdownOption/__tests__/dropdownOption.test.ts +0 -112
- package/src/modules/dx/dropdownOption/__tests__/mockProps.ts +0 -20
- package/src/modules/dx/emptyState/__tests__/emptyState.test.ts +0 -52
- package/src/modules/dx/emptyState/__tests__/mockProps.ts +0 -4
- package/src/modules/dx/emptyState/emptyState.stories.ts +0 -45
- package/src/modules/dx/feature/__tests__/feature.test.ts +0 -51
- package/src/modules/dx/feature/__tests__/mockProps.ts +0 -8
- package/src/modules/dx/featureGrid/__tests__/featureGrid.test.ts +0 -21
- package/src/modules/dx/featureGrid/featureGrid.stories.ts +0 -120
- package/src/modules/dx/featuredContentHeader/__tests__/featuredContentHeader.test.ts +0 -178
- package/src/modules/dx/featuredContentHeader/__tests__/mockProps.ts +0 -73
- package/src/modules/dx/featuredContentHeader/featuredContentHeader.stories.ts +0 -153
- package/src/modules/dx/featuresList/__tests__/featuresList.test.ts +0 -43
- package/src/modules/dx/featuresList/__tests__/mockProps.ts +0 -17
- package/src/modules/dx/featuresList/featuresList.stories.ts +0 -30
- package/src/modules/dx/footer/__tests__/footer.test.ts +0 -147
- package/src/modules/dx/footer/__tests__/mockLocales.ts +0 -7
- package/src/modules/dx/footer/footer.stories.ts +0 -88
- package/src/modules/dx/footerOption/__tests__/footerOption.test.ts +0 -34
- package/src/modules/dx/footerOption/__tests__/mockProps.ts +0 -7
- package/src/modules/dx/formattedDateTime/__tests__/formattedDateTime.test.ts +0 -25
- package/src/modules/dx/formattedDateTime/__tests__/mockProps.ts +0 -13
- package/src/modules/dx/formattedDateTime/formattedDateTime.stories.ts +0 -103
- package/src/modules/dx/grid/__tests__/grid.test.ts +0 -32
- package/src/modules/dx/grid/grid.stories.ts +0 -134
- package/src/modules/dx/groupBio/__tests__/groupBio.test.ts +0 -82
- package/src/modules/dx/groupBio/__tests__/mockProps.ts +0 -15
- package/src/modules/dx/groupBio/groupBio.stories.ts +0 -66
- package/src/modules/dx/groupText/__tests__/groupText.test.ts +0 -69
- package/src/modules/dx/groupText/__tests__/mockProps.ts +0 -35
- package/src/modules/dx/groupText/groupText.stories.ts +0 -81
- package/src/modules/dx/header/__tests__/header.test.ts +0 -236
- package/src/modules/dx/header/__tests__/mockNavArchitects.ts +0 -169
- package/src/modules/dx/header/__tests__/mockNavDevelopers.ts +0 -419
- package/src/modules/dx/header/__tests__/mockNavs.ts +0 -115
- package/src/modules/dx/header/__tests__/mockProps.ts +0 -164
- package/src/modules/dx/header/header.stories.ts +0 -172
- package/src/modules/dx/headerMobileNavMenu/__tests__/headerMobileNavMenu.test.ts +0 -123
- package/src/modules/dx/headerMobileNavMenuOption/__tests__/headerMobileNavMenuOption.test.ts +0 -38
- package/src/modules/dx/headerNav/__tests__/headerNav.test.ts +0 -49
- package/src/modules/dx/headerSearch/__tests__/headerSearch.test.ts +0 -182
- package/src/modules/dx/headerSearch/__tests__/mockData.ts +0 -11
- package/src/modules/dx/headerSearch/__tests__/mockProps.ts +0 -6
- package/src/modules/dx/helmet/__tests__/helmet.test.ts +0 -52
- package/src/modules/dx/helmet/helmet.stories.ts +0 -53
- package/src/modules/dx/hr/__tests__/hr.test.ts +0 -53
- package/src/modules/dx/hr/__tests__/mockProps.ts +0 -16
- package/src/modules/dx/hr/hr.stories.ts +0 -50
- package/src/modules/dx/icon/__tests__/icon.test.ts +0 -54
- package/src/modules/dx/icon/icon.stories.ts +0 -100
- package/src/modules/dx/iconBadge/__tests__/iconBadge.test.ts +0 -17
- package/src/modules/dx/iconBadge/iconBadge.stories.ts +0 -32
- package/src/modules/dx/imageAndLabel/__tests__/imageAndLabel.test.ts +0 -39
- package/src/modules/dx/imageAndLabel/__tests__/mockProps.ts +0 -6
- package/src/modules/dx/imageAndLabel/imageAndLabel.stories.ts +0 -48
- package/src/modules/dx/input/__tests__/input.test.ts +0 -357
- package/src/modules/dx/input/input.stories.ts +0 -102
- package/src/modules/dx/instrumentation/__tests__/instrumentation.test.ts +0 -86
- package/src/modules/dx/interactiveImage/__tests__/interactiveImage.test.ts +0 -83
- package/src/modules/dx/interactiveImage/__tests__/mockProps.ts +0 -39
- package/src/modules/dx/interactiveImage/interactiveImage.stories.ts +0 -31
- package/src/modules/dx/lazy/__tests__/lazy.test.ts +0 -43
- package/src/modules/dx/lazy/lazy.stories.ts +0 -132
- package/src/modules/dx/pagination/__tests__/pagination.test.ts +0 -121
- package/src/modules/dx/pagination/pagination.stories.ts +0 -88
- package/src/modules/dx/podcastHost/__tests__/mockProps.ts +0 -8
- package/src/modules/dx/podcastHost/__tests__/podcastHost.test.ts +0 -21
- package/src/modules/dx/podcastHost/podcastHost.stories.ts +0 -17
- package/src/modules/dx/podcastPlayer/__tests__/podcastPlayer.test.ts +0 -20
- package/src/modules/dx/podcastPlayer/podcastPlayer.stories.ts +0 -13
- package/src/modules/dx/podcastSubscription/__tests__/podcastSubscription.test.ts +0 -16
- package/src/modules/dx/podcastSubscription/podcastSubscription.stories.ts +0 -23
- package/src/modules/dx/popover/__tests__/mockProps.ts +0 -8
- package/src/modules/dx/popover/__tests__/popover.test.ts +0 -313
- package/src/modules/dx/popover/popover.stories.ts +0 -82
- package/src/modules/dx/radioGroup/__tests__/mockProps.ts +0 -12
- package/src/modules/dx/radioGroup/__tests__/radioGroup.test.ts +0 -42
- package/src/modules/dx/radioGroup/radioGroup.stories.ts +0 -25
- package/src/modules/dx/relativeDateTime/__tests__/mockProps.ts +0 -55
- package/src/modules/dx/relativeDateTime/__tests__/relativeDateTime.test.ts +0 -52
- package/src/modules/dx/relativeDateTime/relativeDateTime.stories.ts +0 -83
- package/src/modules/dx/searchResults/searchResults.stories.ts +0 -36
- package/src/modules/dx/section/__tests__/section.test.ts +0 -17
- package/src/modules/dx/section/section.stories.ts +0 -381
- package/src/modules/dx/sectionSignup/__tests__/sectionSignup.test.ts +0 -66
- package/src/modules/dx/sectionSignup/sectionSignup.stories.ts +0 -49
- package/src/modules/dx/select/select.stories.ts +0 -59
- package/src/modules/dx/sidebar/__tests__/mockProps.ts +0 -181
- package/src/modules/dx/sidebar/__tests__/mockSearchChangeEmptyEvent.ts +0 -6
- package/src/modules/dx/sidebar/__tests__/mockSearchChangeEvent.ts +0 -527
- package/src/modules/dx/sidebar/__tests__/sidebar.test.ts +0 -568
- package/src/modules/dx/sidebar/sidebar.stories.ts +0 -188
- package/src/modules/dx/sidebarOld/__tests__/mockProps.ts +0 -178
- package/src/modules/dx/sidebarOld/__tests__/sidebarOld.test.ts +0 -570
- package/src/modules/dx/sidebarOld/sidebarOld.stories.ts +0 -139
- package/src/modules/dx/sidebarSearch/__tests__/mockPreloadedState.ts +0 -1686
- package/src/modules/dx/sidebarSearch/__tests__/sidebarSearch.test.ts +0 -175
- package/src/modules/dx/sidebarSearchResult/__tests__/sidebarSearchResult.test.ts +0 -96
- package/src/modules/dx/slackCta/__tests__/slackCta.test.ts +0 -36
- package/src/modules/dx/slackCta/slackCta.stories.ts +0 -25
- package/src/modules/dx/socials/__tests__/socials.test.ts +0 -114
- package/src/modules/dx/socials/socials.stories.ts +0 -24
- package/src/modules/dx/spinner/__tests__/spinner.test.ts +0 -37
- package/src/modules/dx/spinner/spinner.stories.ts +0 -69
- package/src/modules/dx/tab/__tests__/tab.test.ts +0 -129
- package/src/modules/dx/tab/tab.stories.ts +0 -57
- package/src/modules/dx/toc/__tests__/mockProps.ts +0 -28
- package/src/modules/dx/toc/__tests__/toc.test.ts +0 -109
- package/src/modules/dx/toc/toc.stories.ts +0 -26
- package/src/modules/dx/tooltip/__tests__/tooltip.test.ts +0 -22
- package/src/modules/dx/tooltip/tooltip.stories.ts +0 -46
- package/src/modules/dx/topics/__tests__/mockProps.ts +0 -3
- package/src/modules/dx/topics/__tests__/topics.test.ts +0 -31
- package/src/modules/dx/tree/__tests__/mockProps.ts +0 -215
- package/src/modules/dx/tree/__tests__/tree.test.ts +0 -346
- package/src/modules/dx/tree/__tests__/treeHandler.test.ts +0 -194
- package/src/modules/dx/tree/tree.stories.ts +0 -65
- package/src/modules/dx/treeItem/__tests__/mockProps.ts +0 -46
- package/src/modules/dx/treeItem/__tests__/treeItem.test.ts +0 -377
- package/src/modules/dx/treeTile/__tests__/mockProps.ts +0 -16
- package/src/modules/dx/treeTile/__tests__/treeTile.test.ts +0 -168
- package/src/modules/dx/typeBadge/__tests__/typeBadge.test.ts +0 -77
- package/src/modules/dx/typeBadge/typeBadge.stories.ts +0 -114
- package/src/modules/dx/typeBadgeGroup/__tests__/mockProps.ts +0 -11
- package/src/modules/dx/typeBadgeGroup/__tests__/typeBadgeGroup.test.ts +0 -72
- package/src/modules/dx/typeBadgeGroup/typeBadgeGroup.stories.ts +0 -19
- package/src/modules/test-components/buttonTest/buttonTest.html +0 -3
- package/src/modules/test-components/buttonTest/buttonTest.ts +0 -3
- package/src/modules/test-components/codeBlockTest/codeBlockTest.js +0 -4
- package/src/modules/test-components/featureGridTest/featureGridTest.html +0 -7
- package/src/modules/test-components/featureGridTest/featureGridTest.ts +0 -5
- package/src/modules/test-components/instrumentationTest/instrumentationTest.html +0 -4
- package/src/modules/test-components/instrumentationTest/instrumentationTest.ts +0 -8
- package/src/modules/test-components/popoverTest/popoverTest.html +0 -6
- package/src/modules/test-components/popoverTest/popoverTest.ts +0 -5
- package/src/modules/test-components/slackCtaTest/slackCtaTest.html +0 -3
- package/src/modules/test-components/slackCtaTest/slackCtaTest.ts +0 -3
- package/src/modules/utils/highlight/__tests__/highlight.test.ts +0 -108
- package/src/modules/utils/highlight/__tests__/mockProps.ts +0 -45
- package/src/modules/utils-internal/jest/jest.ts +0 -58
- package/src/modules/utils-internal/recentSearches/__tests__/recentSearches.test.ts +0 -83
- package/src/modules/utils-internal/storybook/storybook.ts +0 -32
- package/src/modules/utils-internal/tests/tests.ts +0 -38
- package/src/modules/utils-internal/wordpress/__tests__/wordpress.test.ts +0 -15
|
@@ -1,568 +0,0 @@
|
|
|
1
|
-
import Button from "dx/button";
|
|
2
|
-
import { track } from "dx/instrumentation";
|
|
3
|
-
import Sidebar from "dx/sidebar";
|
|
4
|
-
import Tree from "dx/tree";
|
|
5
|
-
import SidebarSearch from "dx/sidebarSearch";
|
|
6
|
-
import {
|
|
7
|
-
createMediaMock,
|
|
8
|
-
mockQueryParameter,
|
|
9
|
-
unmockQueryParameter
|
|
10
|
-
} from "utils-internal/jest";
|
|
11
|
-
import { createRenderComponent } from "utils-internal/tests";
|
|
12
|
-
import { coveoXMLDocsConfig } from "utils-internal/coveo";
|
|
13
|
-
import mockSearchChangeEvent from "./mockSearchChangeEvent";
|
|
14
|
-
import mockSearchChangeEmptyEvent from "./mockSearchChangeEmptyEvent";
|
|
15
|
-
import { SAMPLE_TREES } from "./mockProps";
|
|
16
|
-
|
|
17
|
-
jest.mock("dx/instrumentation");
|
|
18
|
-
|
|
19
|
-
const TAG = "dx-sidebar";
|
|
20
|
-
const renderComponent = createRenderComponent(TAG, Sidebar);
|
|
21
|
-
|
|
22
|
-
const COLLAPSED_CLASS = "collapsed";
|
|
23
|
-
const EXPECTED_QUERY = "(max-width: 768px)";
|
|
24
|
-
const GTM_EVENT_NAME = "custEv_leftNavLinkClick";
|
|
25
|
-
const TOGGLE_BUTTON_LABEL = "Toggle Sidebar";
|
|
26
|
-
|
|
27
|
-
describe(TAG, () => {
|
|
28
|
-
describe("desktop", () => {
|
|
29
|
-
beforeEach(() => {
|
|
30
|
-
unmockQueryParameter();
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
describe("component render", () => {
|
|
34
|
-
it("should render as expanded with all the elements that sidebar includes", () => {
|
|
35
|
-
const expectedTitle = "Super cool title";
|
|
36
|
-
const component = renderComponent({
|
|
37
|
-
header: expectedTitle,
|
|
38
|
-
trees: SAMPLE_TREES,
|
|
39
|
-
...coveoXMLDocsConfig
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
const container: HTMLElement =
|
|
43
|
-
component.shadowRoot.querySelector(".container");
|
|
44
|
-
expect(container).not.toBeNull();
|
|
45
|
-
expect(container.classList).not.toContain(COLLAPSED_CLASS);
|
|
46
|
-
|
|
47
|
-
const headerTitle: HTMLElement =
|
|
48
|
-
component.shadowRoot.querySelector(".header h2");
|
|
49
|
-
expect(headerTitle).not.toBeNull();
|
|
50
|
-
expect(headerTitle.textContent).toBe(expectedTitle);
|
|
51
|
-
|
|
52
|
-
const collapseButton: Button =
|
|
53
|
-
component.shadowRoot.querySelector("dx-button");
|
|
54
|
-
expect(collapseButton).not.toBeNull();
|
|
55
|
-
expect(collapseButton.iconSymbol).toBe("close_panel");
|
|
56
|
-
|
|
57
|
-
const search: SidebarSearch =
|
|
58
|
-
component.shadowRoot.querySelector("dx-sidebar-search");
|
|
59
|
-
expect(search).not.toBeNull();
|
|
60
|
-
|
|
61
|
-
const trees: Array<Tree> =
|
|
62
|
-
component.shadowRoot.querySelectorAll("dx-tree");
|
|
63
|
-
expect(trees).toHaveLength(SAMPLE_TREES.length);
|
|
64
|
-
trees.forEach((tree, index) =>
|
|
65
|
-
expect(tree.treeRoot).toHaveProperty(
|
|
66
|
-
"name",
|
|
67
|
-
SAMPLE_TREES[index].name
|
|
68
|
-
)
|
|
69
|
-
);
|
|
70
|
-
|
|
71
|
-
// Mobile specific elements should not render
|
|
72
|
-
const headerTitleDesktop = component.shadowRoot.querySelector(
|
|
73
|
-
".header span.header-title"
|
|
74
|
-
);
|
|
75
|
-
expect(headerTitleDesktop).toBeNull();
|
|
76
|
-
|
|
77
|
-
const toggleButtonDesktop = component.shadowRoot.querySelector(
|
|
78
|
-
".header .header-toggle-icon"
|
|
79
|
-
);
|
|
80
|
-
expect(toggleButtonDesktop).toBeNull();
|
|
81
|
-
|
|
82
|
-
expect(window.matchMedia).toBeCalledTimes(1);
|
|
83
|
-
expect(window.matchMedia).toBeCalledWith(EXPECTED_QUERY);
|
|
84
|
-
|
|
85
|
-
return expect(component).toBeAccessible();
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
it("should accept a json string as trees", () => {
|
|
89
|
-
const expectedTitle = "Other super cool title";
|
|
90
|
-
const component = renderComponent({
|
|
91
|
-
header: expectedTitle,
|
|
92
|
-
trees: JSON.stringify(SAMPLE_TREES),
|
|
93
|
-
...coveoXMLDocsConfig
|
|
94
|
-
});
|
|
95
|
-
|
|
96
|
-
const container: HTMLElement =
|
|
97
|
-
component.shadowRoot.querySelector(".container");
|
|
98
|
-
expect(container).not.toBeNull();
|
|
99
|
-
expect(container.classList).not.toContain(COLLAPSED_CLASS);
|
|
100
|
-
|
|
101
|
-
const headerTitle: HTMLElement =
|
|
102
|
-
component.shadowRoot.querySelector(".header h2");
|
|
103
|
-
expect(headerTitle).not.toBeNull();
|
|
104
|
-
expect(headerTitle.textContent).toBe(expectedTitle);
|
|
105
|
-
|
|
106
|
-
const collapseButton: Button =
|
|
107
|
-
component.shadowRoot.querySelector("dx-button");
|
|
108
|
-
expect(collapseButton).not.toBeNull();
|
|
109
|
-
expect(collapseButton.iconSymbol).toBe("close_panel");
|
|
110
|
-
|
|
111
|
-
const search: SidebarSearch =
|
|
112
|
-
component.shadowRoot.querySelector("dx-sidebar-search");
|
|
113
|
-
expect(search).not.toBeNull();
|
|
114
|
-
|
|
115
|
-
const trees: Array<Tree> =
|
|
116
|
-
component.shadowRoot.querySelectorAll("dx-tree");
|
|
117
|
-
expect(trees).toHaveLength(SAMPLE_TREES.length);
|
|
118
|
-
trees.forEach((tree, index) =>
|
|
119
|
-
expect(tree.treeRoot).toHaveProperty(
|
|
120
|
-
"name",
|
|
121
|
-
SAMPLE_TREES[index].name
|
|
122
|
-
)
|
|
123
|
-
);
|
|
124
|
-
|
|
125
|
-
return expect(component).toBeAccessible();
|
|
126
|
-
});
|
|
127
|
-
|
|
128
|
-
it("should accept a value", () => {
|
|
129
|
-
const testValue = "introduction";
|
|
130
|
-
|
|
131
|
-
const component = renderComponent({
|
|
132
|
-
header: "Non visible title",
|
|
133
|
-
trees: SAMPLE_TREES,
|
|
134
|
-
value: testValue,
|
|
135
|
-
...coveoXMLDocsConfig
|
|
136
|
-
});
|
|
137
|
-
|
|
138
|
-
const trees: Array<Tree> =
|
|
139
|
-
component.shadowRoot.querySelectorAll("dx-tree");
|
|
140
|
-
|
|
141
|
-
expect(trees).toHaveLength(SAMPLE_TREES.length);
|
|
142
|
-
trees.forEach((tree) => expect(tree.value).toBe(testValue));
|
|
143
|
-
|
|
144
|
-
return expect(component).toBeAccessible();
|
|
145
|
-
});
|
|
146
|
-
|
|
147
|
-
it("should render loading ui when ui loads with a non empty query parameter", () => {
|
|
148
|
-
mockQueryParameter("test");
|
|
149
|
-
|
|
150
|
-
const component = renderComponent({
|
|
151
|
-
header: "Super cool title",
|
|
152
|
-
trees: SAMPLE_TREES,
|
|
153
|
-
...coveoXMLDocsConfig
|
|
154
|
-
});
|
|
155
|
-
|
|
156
|
-
const loadingImg: Element = component.shadowRoot.querySelector(
|
|
157
|
-
"img.loading-skeleton"
|
|
158
|
-
);
|
|
159
|
-
|
|
160
|
-
expect(loadingImg).not.toBeNull();
|
|
161
|
-
});
|
|
162
|
-
|
|
163
|
-
it("should not render loading ui when ui loads with an empty query parameter, but should when dx-sidebar-search fires onloading as true", () => {
|
|
164
|
-
const component = renderComponent({
|
|
165
|
-
header: "Super cool title",
|
|
166
|
-
trees: SAMPLE_TREES,
|
|
167
|
-
...coveoXMLDocsConfig
|
|
168
|
-
});
|
|
169
|
-
|
|
170
|
-
const loadingImg: Element = component.shadowRoot.querySelector(
|
|
171
|
-
"img.loading-skeleton"
|
|
172
|
-
);
|
|
173
|
-
expect(loadingImg).toBeNull();
|
|
174
|
-
|
|
175
|
-
const search: SidebarSearch =
|
|
176
|
-
component.shadowRoot.querySelector("dx-sidebar-search");
|
|
177
|
-
search.dispatchEvent(
|
|
178
|
-
new CustomEvent("loading", { detail: true })
|
|
179
|
-
);
|
|
180
|
-
|
|
181
|
-
return Promise.resolve().then(() => {
|
|
182
|
-
const loadingImgAfter: Element =
|
|
183
|
-
component.shadowRoot.querySelector(
|
|
184
|
-
"img.loading-skeleton"
|
|
185
|
-
);
|
|
186
|
-
expect(loadingImgAfter).not.toBeNull();
|
|
187
|
-
});
|
|
188
|
-
});
|
|
189
|
-
|
|
190
|
-
it("should render search results on change of dx-sidebar-search", () => {
|
|
191
|
-
const component = renderComponent({
|
|
192
|
-
header: "Super cool title",
|
|
193
|
-
trees: SAMPLE_TREES,
|
|
194
|
-
...coveoXMLDocsConfig
|
|
195
|
-
});
|
|
196
|
-
|
|
197
|
-
const search: SidebarSearch =
|
|
198
|
-
component.shadowRoot.querySelector("dx-sidebar-search");
|
|
199
|
-
search.dispatchEvent(
|
|
200
|
-
new CustomEvent("change", mockSearchChangeEvent)
|
|
201
|
-
);
|
|
202
|
-
search.dispatchEvent(
|
|
203
|
-
new CustomEvent("loading", { detail: false })
|
|
204
|
-
);
|
|
205
|
-
|
|
206
|
-
return Promise.resolve().then(() => {
|
|
207
|
-
const results = component.shadowRoot.querySelectorAll(
|
|
208
|
-
"dx-sidebar-search-result"
|
|
209
|
-
);
|
|
210
|
-
expect(results).toHaveLength(
|
|
211
|
-
mockSearchChangeEvent.detail.results.length
|
|
212
|
-
);
|
|
213
|
-
});
|
|
214
|
-
});
|
|
215
|
-
|
|
216
|
-
it("should render the empty component if search results return empty", () => {
|
|
217
|
-
const component = renderComponent({
|
|
218
|
-
header: "Super cool title",
|
|
219
|
-
trees: SAMPLE_TREES,
|
|
220
|
-
...coveoXMLDocsConfig
|
|
221
|
-
});
|
|
222
|
-
|
|
223
|
-
const container =
|
|
224
|
-
component.shadowRoot.querySelector(".container");
|
|
225
|
-
expect(container.classList).not.toContain("search-empty");
|
|
226
|
-
|
|
227
|
-
const search: SidebarSearch =
|
|
228
|
-
component.shadowRoot.querySelector("dx-sidebar-search");
|
|
229
|
-
search.dispatchEvent(
|
|
230
|
-
new CustomEvent("change", mockSearchChangeEmptyEvent)
|
|
231
|
-
);
|
|
232
|
-
search.dispatchEvent(
|
|
233
|
-
new CustomEvent("loading", { detail: false })
|
|
234
|
-
);
|
|
235
|
-
|
|
236
|
-
return Promise.resolve().then(() => {
|
|
237
|
-
const results = component.shadowRoot.querySelectorAll(
|
|
238
|
-
"dx-sidebar-search-result"
|
|
239
|
-
);
|
|
240
|
-
|
|
241
|
-
expect(container.classList).toContain("search-empty");
|
|
242
|
-
expect(results).toHaveLength(0);
|
|
243
|
-
});
|
|
244
|
-
});
|
|
245
|
-
});
|
|
246
|
-
|
|
247
|
-
describe("component interactions", () => {
|
|
248
|
-
it("should expand/collapse sidebar when toggle button is clicked", () => {
|
|
249
|
-
const component = renderComponent({
|
|
250
|
-
header: "Cool Title",
|
|
251
|
-
trees: SAMPLE_TREES,
|
|
252
|
-
...coveoXMLDocsConfig
|
|
253
|
-
});
|
|
254
|
-
|
|
255
|
-
const container: HTMLElement =
|
|
256
|
-
component.shadowRoot.querySelector(".container");
|
|
257
|
-
const toggleButton: HTMLElement =
|
|
258
|
-
component.shadowRoot.querySelector("dx-button");
|
|
259
|
-
toggleButton.click();
|
|
260
|
-
|
|
261
|
-
expect(track).toBeCalledTimes(1);
|
|
262
|
-
expect(track).toBeCalledWith(toggleButton, GTM_EVENT_NAME, {
|
|
263
|
-
sideNavAction: "collapse",
|
|
264
|
-
clickText: TOGGLE_BUTTON_LABEL
|
|
265
|
-
});
|
|
266
|
-
|
|
267
|
-
return Promise.resolve()
|
|
268
|
-
.then(() => {
|
|
269
|
-
expect(container.classList).toContain(COLLAPSED_CLASS);
|
|
270
|
-
|
|
271
|
-
const expandButton: Button =
|
|
272
|
-
component.shadowRoot.querySelector("dx-button");
|
|
273
|
-
expect(expandButton).not.toBeNull();
|
|
274
|
-
|
|
275
|
-
toggleButton.click();
|
|
276
|
-
|
|
277
|
-
expect(track).toBeCalledTimes(2);
|
|
278
|
-
expect(track).toHaveBeenLastCalledWith(
|
|
279
|
-
toggleButton,
|
|
280
|
-
GTM_EVENT_NAME,
|
|
281
|
-
{
|
|
282
|
-
sideNavAction: "expand",
|
|
283
|
-
clickText: TOGGLE_BUTTON_LABEL
|
|
284
|
-
}
|
|
285
|
-
);
|
|
286
|
-
})
|
|
287
|
-
.then(() => {
|
|
288
|
-
expect(container.classList).not.toContain(
|
|
289
|
-
COLLAPSED_CLASS
|
|
290
|
-
);
|
|
291
|
-
|
|
292
|
-
return expect(component).toBeAccessible();
|
|
293
|
-
});
|
|
294
|
-
});
|
|
295
|
-
|
|
296
|
-
it("should make hover effect on toggle button hover", () => {
|
|
297
|
-
const component = renderComponent({
|
|
298
|
-
header: "Cool Title",
|
|
299
|
-
trees: SAMPLE_TREES,
|
|
300
|
-
...coveoXMLDocsConfig
|
|
301
|
-
});
|
|
302
|
-
|
|
303
|
-
const container: HTMLElement =
|
|
304
|
-
component.shadowRoot.querySelector(".container");
|
|
305
|
-
const toggleButton: Button =
|
|
306
|
-
component.shadowRoot.querySelector("dx-button");
|
|
307
|
-
|
|
308
|
-
expect(container.classList).not.toContain(
|
|
309
|
-
"container-border-active"
|
|
310
|
-
);
|
|
311
|
-
|
|
312
|
-
toggleButton.dispatchEvent(new MouseEvent("mouseenter"));
|
|
313
|
-
|
|
314
|
-
return Promise.resolve()
|
|
315
|
-
.then(() => {
|
|
316
|
-
expect(container.classList).toContain(
|
|
317
|
-
"container-border-active"
|
|
318
|
-
);
|
|
319
|
-
toggleButton.dispatchEvent(
|
|
320
|
-
new MouseEvent("mouseleave")
|
|
321
|
-
);
|
|
322
|
-
})
|
|
323
|
-
.then(() => {
|
|
324
|
-
expect(container.classList).not.toContain(
|
|
325
|
-
"container-border-active"
|
|
326
|
-
);
|
|
327
|
-
});
|
|
328
|
-
});
|
|
329
|
-
});
|
|
330
|
-
});
|
|
331
|
-
|
|
332
|
-
describe("mobile", () => {
|
|
333
|
-
const oldMatchMedia = window.matchMedia;
|
|
334
|
-
|
|
335
|
-
beforeAll(() => {
|
|
336
|
-
window.matchMedia = createMediaMock(true);
|
|
337
|
-
});
|
|
338
|
-
|
|
339
|
-
afterAll(() => {
|
|
340
|
-
window.matchMedia = oldMatchMedia;
|
|
341
|
-
});
|
|
342
|
-
|
|
343
|
-
describe("render", () => {
|
|
344
|
-
it("should render as collapsed", () => {
|
|
345
|
-
const component = renderComponent({
|
|
346
|
-
trees: SAMPLE_TREES,
|
|
347
|
-
...coveoXMLDocsConfig
|
|
348
|
-
});
|
|
349
|
-
|
|
350
|
-
const container: HTMLElement =
|
|
351
|
-
component.shadowRoot.querySelector(".container");
|
|
352
|
-
expect(container.classList).toContain(COLLAPSED_CLASS);
|
|
353
|
-
|
|
354
|
-
expect(window.matchMedia).toBeCalledTimes(1);
|
|
355
|
-
expect(window.matchMedia).toBeCalledWith(EXPECTED_QUERY);
|
|
356
|
-
|
|
357
|
-
return expect(component).toBeAccessible();
|
|
358
|
-
});
|
|
359
|
-
|
|
360
|
-
it("should ignore null values for trees api", () => {
|
|
361
|
-
const component = renderComponent({
|
|
362
|
-
header: "Cool Title",
|
|
363
|
-
trees: null,
|
|
364
|
-
...coveoXMLDocsConfig
|
|
365
|
-
});
|
|
366
|
-
|
|
367
|
-
const tree: Tree =
|
|
368
|
-
component.shadowRoot.querySelector("dx-tree");
|
|
369
|
-
expect(tree).toBeNull();
|
|
370
|
-
|
|
371
|
-
const headerTitle: HTMLElement =
|
|
372
|
-
component.shadowRoot.querySelector(
|
|
373
|
-
".header span.header-title"
|
|
374
|
-
);
|
|
375
|
-
expect(headerTitle).not.toBeNull();
|
|
376
|
-
expect(headerTitle.textContent).toBe("");
|
|
377
|
-
});
|
|
378
|
-
});
|
|
379
|
-
|
|
380
|
-
describe("component interactions", () => {
|
|
381
|
-
it("should expand/collapse sidebar when mobile toggle is clicked", () => {
|
|
382
|
-
const expectedTitle = SAMPLE_TREES[0].label;
|
|
383
|
-
const component = renderComponent({
|
|
384
|
-
trees: SAMPLE_TREES,
|
|
385
|
-
...coveoXMLDocsConfig
|
|
386
|
-
});
|
|
387
|
-
|
|
388
|
-
const container: HTMLElement =
|
|
389
|
-
component.shadowRoot.querySelector(".container");
|
|
390
|
-
const toggleDiv: HTMLElement =
|
|
391
|
-
component.shadowRoot.querySelector("div.header");
|
|
392
|
-
toggleDiv.click();
|
|
393
|
-
|
|
394
|
-
expect(track).toBeCalledTimes(1);
|
|
395
|
-
expect(track).toBeCalledWith(toggleDiv, GTM_EVENT_NAME, {
|
|
396
|
-
sideNavAction: "expand",
|
|
397
|
-
clickText: TOGGLE_BUTTON_LABEL
|
|
398
|
-
});
|
|
399
|
-
|
|
400
|
-
return Promise.resolve()
|
|
401
|
-
.then(() => {
|
|
402
|
-
expect(container.classList).not.toContain(
|
|
403
|
-
COLLAPSED_CLASS
|
|
404
|
-
);
|
|
405
|
-
const headerTitle: HTMLElement =
|
|
406
|
-
component.shadowRoot.querySelector(
|
|
407
|
-
".header span.header-title"
|
|
408
|
-
);
|
|
409
|
-
expect(headerTitle).not.toBeNull();
|
|
410
|
-
expect(headerTitle.textContent).toBe(expectedTitle);
|
|
411
|
-
|
|
412
|
-
const headerIcon = component.shadowRoot.querySelector(
|
|
413
|
-
".header .header-toggle-icon dx-icon"
|
|
414
|
-
);
|
|
415
|
-
expect(headerIcon).not.toBeNull();
|
|
416
|
-
|
|
417
|
-
const search: HTMLElement =
|
|
418
|
-
component.shadowRoot.querySelector(
|
|
419
|
-
"dx-sidebar-search"
|
|
420
|
-
);
|
|
421
|
-
expect(search).not.toBeNull();
|
|
422
|
-
|
|
423
|
-
const trees: Array<Tree> =
|
|
424
|
-
component.shadowRoot.querySelectorAll("dx-tree");
|
|
425
|
-
expect(trees).toHaveLength(SAMPLE_TREES.length);
|
|
426
|
-
trees.forEach((tree, index) =>
|
|
427
|
-
expect(tree.treeRoot).toHaveProperty(
|
|
428
|
-
"name",
|
|
429
|
-
SAMPLE_TREES[index].name
|
|
430
|
-
)
|
|
431
|
-
);
|
|
432
|
-
|
|
433
|
-
// Desktop specific elements should not render
|
|
434
|
-
const headerTitleDesktop =
|
|
435
|
-
component.shadowRoot.querySelector(
|
|
436
|
-
".header h2.header-title"
|
|
437
|
-
);
|
|
438
|
-
expect(headerTitleDesktop).toBeNull();
|
|
439
|
-
|
|
440
|
-
const toggleButtonDesktop =
|
|
441
|
-
component.shadowRoot.querySelector(
|
|
442
|
-
"dx-button.header-toggle-button"
|
|
443
|
-
);
|
|
444
|
-
expect(toggleButtonDesktop).toBeNull();
|
|
445
|
-
|
|
446
|
-
toggleDiv.click();
|
|
447
|
-
|
|
448
|
-
expect(track).toBeCalledTimes(2);
|
|
449
|
-
expect(track).toHaveBeenLastCalledWith(
|
|
450
|
-
toggleDiv,
|
|
451
|
-
GTM_EVENT_NAME,
|
|
452
|
-
{
|
|
453
|
-
sideNavAction: "collapse",
|
|
454
|
-
clickText: TOGGLE_BUTTON_LABEL
|
|
455
|
-
}
|
|
456
|
-
);
|
|
457
|
-
})
|
|
458
|
-
.then(() => {
|
|
459
|
-
expect(container.classList).toContain(COLLAPSED_CLASS);
|
|
460
|
-
|
|
461
|
-
return expect(component).toBeAccessible();
|
|
462
|
-
});
|
|
463
|
-
});
|
|
464
|
-
|
|
465
|
-
it("should update header with selected value label", () => {
|
|
466
|
-
const defaultTitle = SAMPLE_TREES[0].label;
|
|
467
|
-
const itemToSelect = SAMPLE_TREES[0].children![2];
|
|
468
|
-
const component = renderComponent({
|
|
469
|
-
trees: SAMPLE_TREES,
|
|
470
|
-
...coveoXMLDocsConfig
|
|
471
|
-
});
|
|
472
|
-
|
|
473
|
-
const toggleDiv: HTMLElement =
|
|
474
|
-
component.shadowRoot.querySelector("div.header");
|
|
475
|
-
const headerTitle: HTMLElement = toggleDiv.querySelector(
|
|
476
|
-
".header span.header-title"
|
|
477
|
-
)!;
|
|
478
|
-
|
|
479
|
-
toggleDiv.click();
|
|
480
|
-
|
|
481
|
-
return Promise.resolve()
|
|
482
|
-
.then(() => {
|
|
483
|
-
expect(headerTitle).not.toBeNull();
|
|
484
|
-
expect(headerTitle.textContent).toBe(defaultTitle);
|
|
485
|
-
|
|
486
|
-
const tree: Tree =
|
|
487
|
-
component.shadowRoot.querySelector("dx-tree");
|
|
488
|
-
tree.dispatchEvent(
|
|
489
|
-
new CustomEvent("select", {
|
|
490
|
-
detail: { name: itemToSelect.name }
|
|
491
|
-
})
|
|
492
|
-
);
|
|
493
|
-
})
|
|
494
|
-
.then(() => {
|
|
495
|
-
expect(headerTitle.textContent).toBe(
|
|
496
|
-
itemToSelect.label
|
|
497
|
-
);
|
|
498
|
-
return expect(component).toBeAccessible();
|
|
499
|
-
});
|
|
500
|
-
});
|
|
501
|
-
});
|
|
502
|
-
});
|
|
503
|
-
|
|
504
|
-
describe("general", () => {
|
|
505
|
-
describe("render", () => {
|
|
506
|
-
it("should accept a single tree element", () => {
|
|
507
|
-
const [expectedTree] = SAMPLE_TREES;
|
|
508
|
-
const component = renderComponent({
|
|
509
|
-
header: "Cool Title",
|
|
510
|
-
trees: expectedTree,
|
|
511
|
-
...coveoXMLDocsConfig
|
|
512
|
-
});
|
|
513
|
-
|
|
514
|
-
const trees: Array<Tree> =
|
|
515
|
-
component.shadowRoot.querySelectorAll("dx-tree");
|
|
516
|
-
expect(trees).toHaveLength(1);
|
|
517
|
-
|
|
518
|
-
const [singleTree] = trees;
|
|
519
|
-
expect(singleTree.treeRoot).toHaveProperty(
|
|
520
|
-
"name",
|
|
521
|
-
expectedTree.name
|
|
522
|
-
);
|
|
523
|
-
});
|
|
524
|
-
});
|
|
525
|
-
|
|
526
|
-
describe("component interactions", () => {
|
|
527
|
-
it("should handle onselect event fired from dx-tree", () => {
|
|
528
|
-
const mockSelect = jest.fn();
|
|
529
|
-
const expectedName = "test_name";
|
|
530
|
-
|
|
531
|
-
const component = renderComponent({
|
|
532
|
-
header: "Cool Title",
|
|
533
|
-
trees: SAMPLE_TREES,
|
|
534
|
-
...coveoXMLDocsConfig
|
|
535
|
-
});
|
|
536
|
-
|
|
537
|
-
component.addEventListener("select", mockSelect);
|
|
538
|
-
|
|
539
|
-
const tree: Tree =
|
|
540
|
-
component.shadowRoot.querySelector("dx-tree");
|
|
541
|
-
expect(tree).not.toBeNull();
|
|
542
|
-
expect(tree.value).toBeUndefined();
|
|
543
|
-
|
|
544
|
-
tree.dispatchEvent(
|
|
545
|
-
new CustomEvent("select", {
|
|
546
|
-
detail: { name: expectedName },
|
|
547
|
-
composed: true,
|
|
548
|
-
bubbles: true
|
|
549
|
-
})
|
|
550
|
-
);
|
|
551
|
-
|
|
552
|
-
return Promise.resolve().then(() => {
|
|
553
|
-
expect(tree.value).toBe(expectedName);
|
|
554
|
-
expect(mockSelect).toBeCalledTimes(1);
|
|
555
|
-
const { detail, composed, bubbles } =
|
|
556
|
-
mockSelect.mock.calls[0][0];
|
|
557
|
-
expect(detail).toEqual({
|
|
558
|
-
name: expectedName
|
|
559
|
-
});
|
|
560
|
-
expect(composed).toBe(true);
|
|
561
|
-
expect(bubbles).toBe(true);
|
|
562
|
-
|
|
563
|
-
return expect(component).toBeAccessible();
|
|
564
|
-
});
|
|
565
|
-
});
|
|
566
|
-
});
|
|
567
|
-
});
|
|
568
|
-
});
|