diff --git a/packages/web-components/src/components/link-list/__stories__/README.stories.mdx b/packages/web-components/src/components/link-list/__stories__/README.stories.mdx index 1d0c803fe42..ac943d7adb1 100644 --- a/packages/web-components/src/components/link-list/__stories__/README.stories.mdx +++ b/packages/web-components/src/components/link-list/__stories__/README.stories.mdx @@ -26,12 +26,20 @@ import '@carbon/ibmdotcom-web-components/es/components/card-link/card-link.js'; ```html - - - +

Copy text

-
@@ -42,4 +50,12 @@ import '@carbon/ibmdotcom-web-components/es/components/card-link/card-link.js'; +## Stable selectors + +See [our README](https://github.com/carbon-design-system/carbon-for-ibm-dotcom/tree/master/packages/web-components#stable-selectors-for-analytics-and-integratione2e-testing-in-web-components) to see how Web Components selector and `data-autoid` should be used. + +| Web Components selector | Compatibility selector | Description | +| ----------------------- | ---------------------------- | ----------- | +| `` | data-autoid="dds--link-list" | Component | + diff --git a/packages/web-components/src/components/link-list/link-list.ts b/packages/web-components/src/components/link-list/link-list.ts index 977e52af5d9..19c18b2abf6 100644 --- a/packages/web-components/src/components/link-list/link-list.ts +++ b/packages/web-components/src/components/link-list/link-list.ts @@ -10,6 +10,7 @@ import { customElement, html, LitElement, property } from 'lit-element'; import settings from 'carbon-components/es/globals/js/settings'; import ddsSettings from '@carbon/ibmdotcom-utilities/es/utilities/settings/settings'; import sameHeight from '@carbon/ibmdotcom-utilities/es/utilities/sameHeight/sameHeight'; +import StableSelectorMixin from '../../globals/mixins/stable-selector'; import styles from './link-list.scss'; const { prefix } = settings; @@ -47,7 +48,7 @@ export enum LINK_LIST_TYPE { * @slot heading - The heading content. */ @customElement(`${ddsPrefix}-link-list`) -class DDSLinkList extends LitElement { +class DDSLinkList extends StableSelectorMixin(LitElement) { static styles = styles; // `styles` here is a `CSSResult` generated by custom WebPack loader private childItems;