@salesforcedevs/dx-components 0.26.1 → 0.27.1
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/podcastSubscription/podcastSubscription.css +1 -2
- 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 +14 -8
- package/src/modules/dx/slackCta/slackCta.html +2 -2
- package/src/modules/dx/slackCta/slackCta.ts +0 -1
- 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 -48
- 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/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,129 +0,0 @@
|
|
|
1
|
-
import Tab from "dx/tab";
|
|
2
|
-
import Icon from "dx/icon";
|
|
3
|
-
import { track } from "dx/instrumentation";
|
|
4
|
-
import { createRenderComponent } from "utils-internal/tests";
|
|
5
|
-
|
|
6
|
-
jest.mock("dx/instrumentation");
|
|
7
|
-
|
|
8
|
-
const TAG = "dx-tab";
|
|
9
|
-
const render = createRenderComponent(TAG, Tab);
|
|
10
|
-
|
|
11
|
-
const PROPS = {
|
|
12
|
-
label: "documentation",
|
|
13
|
-
href: "/test"
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
describe(TAG, () => {
|
|
17
|
-
it("renders a single link with a label", () => {
|
|
18
|
-
const element = render(PROPS);
|
|
19
|
-
|
|
20
|
-
const links: Array<HTMLAnchorElement> =
|
|
21
|
-
element.shadowRoot.querySelectorAll("a");
|
|
22
|
-
|
|
23
|
-
expect(links.length).toEqual(1);
|
|
24
|
-
const [singleLink] = links;
|
|
25
|
-
expect(singleLink.href).toMatch(PROPS.href);
|
|
26
|
-
expect(singleLink.classList).toHaveLength(2);
|
|
27
|
-
expect(singleLink.classList).toContain("nav-list-item");
|
|
28
|
-
expect(singleLink.classList).toContain("nav-list-item_default");
|
|
29
|
-
|
|
30
|
-
const span: HTMLElement = singleLink.querySelector("span")!;
|
|
31
|
-
expect(span.textContent).toBe(PROPS.label);
|
|
32
|
-
|
|
33
|
-
expect(element.shadowRoot.querySelector("button")).toBeNull();
|
|
34
|
-
|
|
35
|
-
return expect(element).toBeAccessible();
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
it("renders a link as active and small variant", () => {
|
|
39
|
-
const element = render({ ...PROPS, isActive: true, variant: "small" });
|
|
40
|
-
|
|
41
|
-
const link: HTMLAnchorElement = element.shadowRoot.querySelector("a");
|
|
42
|
-
|
|
43
|
-
expect(link.href).toMatch(PROPS.href);
|
|
44
|
-
expect(link.classList).toHaveLength(3);
|
|
45
|
-
expect(link.classList).toContain("nav-list-item");
|
|
46
|
-
expect(link.classList).toContain("nav-list-item_small");
|
|
47
|
-
expect(link.classList).toContain("state-active");
|
|
48
|
-
|
|
49
|
-
expect(element.shadowRoot.querySelector("button")).toBeNull();
|
|
50
|
-
|
|
51
|
-
return expect(element).toBeAccessible();
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
it("renders a button if no href provided", () => {
|
|
55
|
-
const label = "test button";
|
|
56
|
-
const element = render({ label });
|
|
57
|
-
|
|
58
|
-
const buttons: Array<HTMLButtonElement> =
|
|
59
|
-
element.shadowRoot.querySelectorAll("button");
|
|
60
|
-
|
|
61
|
-
expect(buttons).toHaveLength(1);
|
|
62
|
-
const [singleButton] = buttons;
|
|
63
|
-
|
|
64
|
-
expect(singleButton.classList).toHaveLength(2);
|
|
65
|
-
expect(singleButton.classList).toContain("nav-list-item");
|
|
66
|
-
expect(singleButton.classList).toContain("nav-list-item_default");
|
|
67
|
-
|
|
68
|
-
const span: HTMLElement = singleButton.querySelector("span")!;
|
|
69
|
-
expect(span.textContent).toBe(label);
|
|
70
|
-
|
|
71
|
-
return expect(element).toBeAccessible();
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
it("renders a button with an icon if useIcon is passed as true", () => {
|
|
75
|
-
const label = "test button";
|
|
76
|
-
const element = render({ label, useIcon: true });
|
|
77
|
-
|
|
78
|
-
const buttons: Array<HTMLButtonElement> =
|
|
79
|
-
element.shadowRoot.querySelectorAll("button");
|
|
80
|
-
|
|
81
|
-
expect(buttons).toHaveLength(1);
|
|
82
|
-
const [singleButton] = buttons;
|
|
83
|
-
|
|
84
|
-
const span: HTMLElement = singleButton.querySelector("span")!;
|
|
85
|
-
expect(span.textContent).toBe(label);
|
|
86
|
-
|
|
87
|
-
const icon: Element & Icon = singleButton.querySelector("dx-icon")!;
|
|
88
|
-
expect(icon).not.toBeNull();
|
|
89
|
-
expect(icon.size).toBe("small");
|
|
90
|
-
|
|
91
|
-
return expect(element).toBeAccessible();
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
it("renders a button with label only if variant is small", () => {
|
|
95
|
-
const label = "test button";
|
|
96
|
-
const element = render({ label, variant: "small", useIcon: "true" });
|
|
97
|
-
|
|
98
|
-
const button: HTMLButtonElement =
|
|
99
|
-
element.shadowRoot.querySelector("button");
|
|
100
|
-
|
|
101
|
-
expect(button.classList).toHaveLength(2);
|
|
102
|
-
expect(button.classList).toContain("nav-list-item");
|
|
103
|
-
expect(button.classList).toContain("nav-list-item_small");
|
|
104
|
-
|
|
105
|
-
const span: HTMLElement = button.querySelector("span")!;
|
|
106
|
-
expect(span.textContent).toBe(label);
|
|
107
|
-
|
|
108
|
-
const icon: Element & Icon = button.querySelector("dx-icon")!;
|
|
109
|
-
expect(icon).not.toBeNull();
|
|
110
|
-
expect(icon.size).toBe("xsmall");
|
|
111
|
-
|
|
112
|
-
return expect(element).toBeAccessible();
|
|
113
|
-
});
|
|
114
|
-
|
|
115
|
-
it("calls track when the link is clicked", () => {
|
|
116
|
-
const element = render(PROPS);
|
|
117
|
-
|
|
118
|
-
const link: HTMLElement = element.shadowRoot.querySelector("a");
|
|
119
|
-
expect(link).not.toBeNull();
|
|
120
|
-
link.click();
|
|
121
|
-
|
|
122
|
-
expect(track).toHaveBeenCalledTimes(1);
|
|
123
|
-
expect(track).toBeCalledWith(link, "custEv_topNavLinkClick", {
|
|
124
|
-
navHeading: PROPS.label,
|
|
125
|
-
clickText: PROPS.href,
|
|
126
|
-
pageLocation: window.location.pathname
|
|
127
|
-
});
|
|
128
|
-
});
|
|
129
|
-
});
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { html } from "lit-html";
|
|
2
|
-
import { TabVariant } from "typings/custom";
|
|
3
|
-
|
|
4
|
-
type StoryArgs = {
|
|
5
|
-
isActive: boolean;
|
|
6
|
-
label: string;
|
|
7
|
-
useIcon: boolean;
|
|
8
|
-
variant: TabVariant;
|
|
9
|
-
};
|
|
10
|
-
const VARIANT_OPTIONS: Array<TabVariant> = ["default", "small"];
|
|
11
|
-
|
|
12
|
-
export default {
|
|
13
|
-
title: "dx/dx-tab",
|
|
14
|
-
component: "dx-tab",
|
|
15
|
-
argTypes: {
|
|
16
|
-
variant: {
|
|
17
|
-
control: {
|
|
18
|
-
type: "select",
|
|
19
|
-
options: VARIANT_OPTIONS
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
const Template = ({ variant, label, isActive, useIcon }: StoryArgs) => html`
|
|
26
|
-
<dx-tab
|
|
27
|
-
label="${label}"
|
|
28
|
-
is-active="${isActive}"
|
|
29
|
-
variant="${variant}"
|
|
30
|
-
use-icon="${useIcon}"
|
|
31
|
-
></dx-tab>
|
|
32
|
-
`;
|
|
33
|
-
|
|
34
|
-
export const Base = (args: StoryArgs) => Template(args);
|
|
35
|
-
Base.args = {
|
|
36
|
-
isActive: false,
|
|
37
|
-
useIcon: false,
|
|
38
|
-
label: "Banana",
|
|
39
|
-
variant: VARIANT_OPTIONS[0]
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
export const TabGroup = ({ variant }: { variant: TabVariant }) => html`
|
|
43
|
-
<style>
|
|
44
|
-
.container {
|
|
45
|
-
display: flex;
|
|
46
|
-
--dx-c-tab-horizontal-spacing: var(--dx-g-spacing-xs);
|
|
47
|
-
}
|
|
48
|
-
</style>
|
|
49
|
-
<nav class="container">
|
|
50
|
-
<dx-tab label="Banana" variant="${variant}"></dx-tab>
|
|
51
|
-
<dx-tab label="Apple" variant="${variant}"></dx-tab>
|
|
52
|
-
</nav>
|
|
53
|
-
`;
|
|
54
|
-
|
|
55
|
-
TabGroup.args = {
|
|
56
|
-
variant: VARIANT_OPTIONS[0]
|
|
57
|
-
};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
title: "In this guide",
|
|
3
|
-
value: "intro",
|
|
4
|
-
options: [
|
|
5
|
-
{
|
|
6
|
-
label: "Introduction",
|
|
7
|
-
id: "intro",
|
|
8
|
-
anchor: "#test1"
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
label: "Deep dive: Registering the Record Class",
|
|
12
|
-
id: "deepdive",
|
|
13
|
-
anchor: "#test2"
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
label:
|
|
17
|
-
"Why build on Quip? This is an extra long blurb to test the toc wrapping ability",
|
|
18
|
-
id: "quip",
|
|
19
|
-
anchor: "#test3"
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
label:
|
|
23
|
-
"SomeLongExampleWordWithoutAnyBreaks and Then a Word",
|
|
24
|
-
id: "long-word",
|
|
25
|
-
anchor: "#test4"
|
|
26
|
-
}
|
|
27
|
-
]
|
|
28
|
-
};
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import Button from "dx/button";
|
|
2
|
-
import Toc from "dx/toc";
|
|
3
|
-
import { createRenderComponent } from "utils-internal/tests";
|
|
4
|
-
import mockProps from "./mockProps";
|
|
5
|
-
|
|
6
|
-
const TAG = "dx-toc";
|
|
7
|
-
const render = createRenderComponent(TAG, Toc);
|
|
8
|
-
|
|
9
|
-
describe(TAG, () => {
|
|
10
|
-
it("renders", () => {
|
|
11
|
-
const element = render(mockProps);
|
|
12
|
-
|
|
13
|
-
const container: HTMLElement = element.shadowRoot.querySelector(".toc");
|
|
14
|
-
const renderedTitle: HTMLElement =
|
|
15
|
-
element.shadowRoot.querySelector("h2");
|
|
16
|
-
const button: Button =
|
|
17
|
-
element.shadowRoot.querySelector(".toggle-button");
|
|
18
|
-
expect(renderedTitle).not.toBeNull();
|
|
19
|
-
expect(container).not.toBeNull();
|
|
20
|
-
expect(renderedTitle.textContent).toEqual(mockProps.title);
|
|
21
|
-
expect(button.iconSymbol).toEqual("open_panel");
|
|
22
|
-
return expect(element).toBeAccessible();
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
it("renders table of contents buttons, and the first one is selected", () => {
|
|
26
|
-
const element = render(mockProps);
|
|
27
|
-
|
|
28
|
-
const optionsListComponent: Array<HTMLElement> =
|
|
29
|
-
element.shadowRoot.querySelectorAll("a");
|
|
30
|
-
expect(optionsListComponent).toHaveLength(mockProps.options.length);
|
|
31
|
-
expect(optionsListComponent[0].className).toEqual(
|
|
32
|
-
"content-button selected"
|
|
33
|
-
);
|
|
34
|
-
return expect(element).toBeAccessible();
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
it('sends custom event "selectedcontent" with id on click', () => {
|
|
38
|
-
const element = render(mockProps);
|
|
39
|
-
|
|
40
|
-
const EVENT_DETAIL_PARAMETER = { name: mockProps.options[0].id };
|
|
41
|
-
const handler = jest.fn();
|
|
42
|
-
element.addEventListener("selectedcontent", handler);
|
|
43
|
-
|
|
44
|
-
return Promise.resolve().then(() => {
|
|
45
|
-
const linkEl = element.shadowRoot.querySelector("a");
|
|
46
|
-
linkEl.click();
|
|
47
|
-
expect(handler).toHaveBeenCalled();
|
|
48
|
-
expect(handler.mock.calls[0][0].detail).toEqual(
|
|
49
|
-
EVENT_DETAIL_PARAMETER
|
|
50
|
-
);
|
|
51
|
-
return expect(element).toBeAccessible();
|
|
52
|
-
});
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
it('Validate "value" recieved ', () => {
|
|
56
|
-
const element = render({ ...mockProps });
|
|
57
|
-
|
|
58
|
-
return Promise.resolve().then(() => {
|
|
59
|
-
const optionsListComponent: Array<HTMLElement> =
|
|
60
|
-
element.shadowRoot.querySelectorAll("a");
|
|
61
|
-
optionsListComponent.forEach((e) => {
|
|
62
|
-
if (e.getAttribute("contentid") === mockProps.value) {
|
|
63
|
-
expect(e.className).toEqual("content-button selected");
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
return expect(element).toBeAccessible();
|
|
67
|
-
});
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
it('Validate no "value" recieved', () => {
|
|
71
|
-
const element = render({ ...mockProps, value: undefined });
|
|
72
|
-
|
|
73
|
-
return Promise.resolve().then(() => {
|
|
74
|
-
const buttons: Array<HTMLElement> =
|
|
75
|
-
element.shadowRoot.querySelectorAll("a");
|
|
76
|
-
expect(buttons[0].className).toEqual("content-button selected");
|
|
77
|
-
return expect(element).toBeAccessible();
|
|
78
|
-
});
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
it("toggles the hidden className on click of toggle button", () => {
|
|
82
|
-
const element = render(mockProps);
|
|
83
|
-
|
|
84
|
-
const linkToggle = element.shadowRoot.querySelector(".toggle-button");
|
|
85
|
-
linkToggle.click();
|
|
86
|
-
return Promise.resolve().then(() => {
|
|
87
|
-
const container = element.shadowRoot.querySelector(".toc_content");
|
|
88
|
-
expect(container).toBe(null);
|
|
89
|
-
return expect(element).toBeAccessible();
|
|
90
|
-
});
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
it("test list recieved as string ", () => {
|
|
94
|
-
const optionsListParameter = [
|
|
95
|
-
{ label: "Introduction", id: "12312", anchor: "#test" }
|
|
96
|
-
];
|
|
97
|
-
const element = render({
|
|
98
|
-
...mockProps,
|
|
99
|
-
options: JSON.stringify(optionsListParameter)
|
|
100
|
-
});
|
|
101
|
-
|
|
102
|
-
return Promise.resolve().then(() => {
|
|
103
|
-
const optionListComponent: Array<HTMLElement> =
|
|
104
|
-
element.shadowRoot.querySelectorAll("a");
|
|
105
|
-
expect(optionListComponent).toHaveLength(element.options.length);
|
|
106
|
-
return expect(element).toBeAccessible();
|
|
107
|
-
});
|
|
108
|
-
});
|
|
109
|
-
});
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { html } from "lit-html";
|
|
2
|
-
import mockProps from "./__tests__/mockProps";
|
|
3
|
-
|
|
4
|
-
export default {
|
|
5
|
-
title: "dx/dx-toc",
|
|
6
|
-
component: "dx-toc"
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
const options = JSON.stringify(mockProps.options);
|
|
10
|
-
// prettier-ignore
|
|
11
|
-
export const Base = () => html`
|
|
12
|
-
<dx-toc
|
|
13
|
-
title="In this guide"
|
|
14
|
-
options="${options}"
|
|
15
|
-
value="intro"
|
|
16
|
-
>
|
|
17
|
-
<dx-button
|
|
18
|
-
slot="view-pdf"
|
|
19
|
-
href="http://www.google.com"
|
|
20
|
-
target="_blank"
|
|
21
|
-
variant="inline"
|
|
22
|
-
icon-symbol="new_window"
|
|
23
|
-
>
|
|
24
|
-
View PDF
|
|
25
|
-
</dx-button>
|
|
26
|
-
</dx-toc>`;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import Tooltip from "dx/tooltip";
|
|
2
|
-
import { createRenderComponent } from "utils-internal/tests";
|
|
3
|
-
|
|
4
|
-
const TAG = "dx-tooltip";
|
|
5
|
-
const render = createRenderComponent(TAG, Tooltip);
|
|
6
|
-
|
|
7
|
-
describe(TAG, () => {
|
|
8
|
-
it("calls tippy constructor with correct parameters", () => {
|
|
9
|
-
const element = render({ label: "First Label", placement: "top" });
|
|
10
|
-
|
|
11
|
-
const slotContainer: HTMLElement =
|
|
12
|
-
element.shadowRoot.querySelector("div");
|
|
13
|
-
|
|
14
|
-
expect(slotContainer).not.toBeNull();
|
|
15
|
-
expect(slotContainer.getAttribute("data-microtip-position")).toEqual(
|
|
16
|
-
"top"
|
|
17
|
-
);
|
|
18
|
-
expect(slotContainer.getAttribute("aria-label")).toEqual("First Label");
|
|
19
|
-
|
|
20
|
-
return expect(element).toBeAccessible();
|
|
21
|
-
});
|
|
22
|
-
});
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { html } from "lit-html";
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
title: "dx/dx-tooltip",
|
|
5
|
-
component: "dx-tooltip",
|
|
6
|
-
argTypes: {
|
|
7
|
-
placement: {
|
|
8
|
-
defaultValue: "top",
|
|
9
|
-
control: {
|
|
10
|
-
type: "select",
|
|
11
|
-
options: [
|
|
12
|
-
"top",
|
|
13
|
-
"top-left",
|
|
14
|
-
"top-right",
|
|
15
|
-
"bottom",
|
|
16
|
-
"bottom-left",
|
|
17
|
-
"bottom-right",
|
|
18
|
-
"left",
|
|
19
|
-
"right"
|
|
20
|
-
]
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
|
-
label: {
|
|
24
|
-
defaultValue: "Hello, world!",
|
|
25
|
-
control: {
|
|
26
|
-
type: "text"
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
// prettier-ignore
|
|
33
|
-
const createStyles = () => html `
|
|
34
|
-
<style>
|
|
35
|
-
.story-container {
|
|
36
|
-
margin: 100px;
|
|
37
|
-
}
|
|
38
|
-
</style>`;
|
|
39
|
-
|
|
40
|
-
// prettier-ignore
|
|
41
|
-
export const Default = (args: any) => html `${createStyles()}
|
|
42
|
-
<div class="story-container">
|
|
43
|
-
<dx-tooltip label="${args.label}" placement="${args.placement}">
|
|
44
|
-
<button>Hover</button>
|
|
45
|
-
</dx-tooltip>
|
|
46
|
-
</div>`;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import Topics from "dx/topics";
|
|
2
|
-
import { createRenderComponent } from "utils-internal/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
|
-
});
|
|
@@ -1,215 +0,0 @@
|
|
|
1
|
-
import { InternalTreeNode, TreeNode } from "typings/custom";
|
|
2
|
-
|
|
3
|
-
export const SAMPLE_TREE_ONE_LEVEL: TreeNode = {
|
|
4
|
-
label: "Getting started",
|
|
5
|
-
name: "started",
|
|
6
|
-
isExpanded: true,
|
|
7
|
-
children: [
|
|
8
|
-
{
|
|
9
|
-
label: "Introduction",
|
|
10
|
-
name: "introduction"
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
label: "Getting started",
|
|
14
|
-
name: "started-child"
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
label: "Authentication",
|
|
18
|
-
name: "authentication"
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
label: "Token",
|
|
22
|
-
name: "token"
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
label: "Error",
|
|
26
|
-
name: "error"
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
label: "Limits",
|
|
30
|
-
name: "limit"
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
label: "Release note",
|
|
34
|
-
name: "release-note"
|
|
35
|
-
}
|
|
36
|
-
]
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
export const SAMPLE_TREE_MULTIPLE_LEVELS: TreeNode = {
|
|
40
|
-
label: "Einstein Vision",
|
|
41
|
-
name: "einstein-vision",
|
|
42
|
-
children: [
|
|
43
|
-
{
|
|
44
|
-
label: "Introduction",
|
|
45
|
-
name: "introduction"
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
label: "Terminology",
|
|
49
|
-
name: "terminology"
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
label: "Object detection quickstart for beginner",
|
|
53
|
-
name: "object-quickstart",
|
|
54
|
-
children: [
|
|
55
|
-
{
|
|
56
|
-
label: "Scenario",
|
|
57
|
-
name: "scenario",
|
|
58
|
-
children: [
|
|
59
|
-
{
|
|
60
|
-
label: "Scenario A",
|
|
61
|
-
name: "scenario-a"
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
label: "Scenario B",
|
|
65
|
-
name: "scenario-b"
|
|
66
|
-
}
|
|
67
|
-
]
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
label: "Prerequisites",
|
|
71
|
-
name: "prerequisites"
|
|
72
|
-
}
|
|
73
|
-
]
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
label: "Best Practices",
|
|
77
|
-
name: "best-practices"
|
|
78
|
-
}
|
|
79
|
-
]
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
export const SAMPLE_TREE_WITH_LINKS: TreeNode = {
|
|
83
|
-
label: "Introduction",
|
|
84
|
-
name: "introduction",
|
|
85
|
-
isExpanded: true,
|
|
86
|
-
children: [
|
|
87
|
-
{
|
|
88
|
-
label: "Generate an OAuth Token",
|
|
89
|
-
name: "oauth-token",
|
|
90
|
-
link: {
|
|
91
|
-
href: "/oauth"
|
|
92
|
-
}
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
label: "Delete a Refresh Token",
|
|
96
|
-
name: "refresh-token",
|
|
97
|
-
link: {
|
|
98
|
-
href: "/refresh"
|
|
99
|
-
}
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
label: "Get API Usage",
|
|
103
|
-
name: "api-usage",
|
|
104
|
-
link: {
|
|
105
|
-
href: "/usage"
|
|
106
|
-
}
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
label: "Error",
|
|
110
|
-
name: "error",
|
|
111
|
-
link: {
|
|
112
|
-
href: "/error"
|
|
113
|
-
}
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
label: "External",
|
|
117
|
-
name: "external",
|
|
118
|
-
children: [
|
|
119
|
-
{
|
|
120
|
-
label: "Salesforce",
|
|
121
|
-
name: "salesforce",
|
|
122
|
-
link: {
|
|
123
|
-
href: "https://www.salesforce.com/",
|
|
124
|
-
target: "_blank"
|
|
125
|
-
}
|
|
126
|
-
},
|
|
127
|
-
{
|
|
128
|
-
label: "Google",
|
|
129
|
-
name: "google",
|
|
130
|
-
link: {
|
|
131
|
-
href: "https://www.google.com/",
|
|
132
|
-
target: "_blank"
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
]
|
|
136
|
-
}
|
|
137
|
-
]
|
|
138
|
-
};
|
|
139
|
-
|
|
140
|
-
export const SAMPLE_TREE_WITH_BADGES: TreeNode = {
|
|
141
|
-
label: "Getting started",
|
|
142
|
-
name: "started",
|
|
143
|
-
isExpanded: true,
|
|
144
|
-
children: [
|
|
145
|
-
{
|
|
146
|
-
label: "Introduction",
|
|
147
|
-
name: "introduction",
|
|
148
|
-
method: "post"
|
|
149
|
-
},
|
|
150
|
-
{
|
|
151
|
-
label: "Getting started",
|
|
152
|
-
name: "started-child",
|
|
153
|
-
method: "get"
|
|
154
|
-
},
|
|
155
|
-
{
|
|
156
|
-
label: "Authentication",
|
|
157
|
-
name: "authentication",
|
|
158
|
-
method: "delete"
|
|
159
|
-
},
|
|
160
|
-
{
|
|
161
|
-
label: "Token",
|
|
162
|
-
name: "token",
|
|
163
|
-
method: "patch"
|
|
164
|
-
},
|
|
165
|
-
{
|
|
166
|
-
label: "Error",
|
|
167
|
-
name: "error",
|
|
168
|
-
method: "put"
|
|
169
|
-
},
|
|
170
|
-
{
|
|
171
|
-
label: "Limits",
|
|
172
|
-
name: "limit",
|
|
173
|
-
method: "get"
|
|
174
|
-
},
|
|
175
|
-
{
|
|
176
|
-
label: "Release note",
|
|
177
|
-
name: "release-note",
|
|
178
|
-
method: "post"
|
|
179
|
-
}
|
|
180
|
-
]
|
|
181
|
-
};
|
|
182
|
-
|
|
183
|
-
export const INITIALIZE_MOCK_PARAMETER: TreeNode = {
|
|
184
|
-
label: "Test Label",
|
|
185
|
-
name: "test-name",
|
|
186
|
-
isExpanded: true,
|
|
187
|
-
link: {
|
|
188
|
-
href: "https://salesforce.com",
|
|
189
|
-
target: "_blank"
|
|
190
|
-
}
|
|
191
|
-
};
|
|
192
|
-
|
|
193
|
-
export const INITIALIZE_MOCK_RESULT: InternalTreeNode = {
|
|
194
|
-
...INITIALIZE_MOCK_PARAMETER,
|
|
195
|
-
key: "0",
|
|
196
|
-
level: 0,
|
|
197
|
-
children: []
|
|
198
|
-
};
|
|
199
|
-
|
|
200
|
-
export const MOCK_TILE_DETAIL = {
|
|
201
|
-
detail: {
|
|
202
|
-
key: "0.1",
|
|
203
|
-
name: "test name"
|
|
204
|
-
},
|
|
205
|
-
composed: true,
|
|
206
|
-
bubble: true
|
|
207
|
-
};
|
|
208
|
-
|
|
209
|
-
export const MOCK_ICON_DETAIL = {
|
|
210
|
-
detail: {
|
|
211
|
-
key: "0.1"
|
|
212
|
-
},
|
|
213
|
-
composed: true,
|
|
214
|
-
bubble: true
|
|
215
|
-
};
|