-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(TruncatedList): new component TruncatedList #4139
feat(TruncatedList): new component TruncatedList #4139
Conversation
✅ Deploy Preview for carbon-for-ibm-products ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
<ListItem>Item 5</ListItem> | ||
</TruncatedList> | ||
); | ||
expect(document.querySelectorAll(`li`).length).toBe(2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use getByRole
here to avoid using document.querySelector
.
Possibly something like the follow:
expect(screen.getByRole('listitem').length).toBe(2);
<ListItem>Item 2</ListItem> | ||
</TruncatedList> | ||
); | ||
expect(document.querySelector(`.${blockClass}`)).toHaveClass(className); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use data-testid
here to avoid document.querySelector
.
<ListItem>Item 2</ListItem> | ||
</TruncatedList> | ||
); | ||
expect(document.querySelector(`.${blockClass}`)).toBeInTheDocument(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use data-testid
here to avoid document.querySelector
.
bc54d2f
Contributes to #4071
Migrating TruncatedList from
Products v1 / Security / TruncatedList
.v1
references: GitHub, Storybook.What did you change?
This is a new
v2
component.Prop updates
getExpandButtonLabelviewLessLabel
andviewMoreLabel
.truncateThresholdscrollGradientColorHow did you test and verify your work?