Skip to content

Commit

Permalink
[ResourceList] Add test to prevent future regression (#8589)
Browse files Browse the repository at this point in the history
Shipped a hotfix in a hurry ~~today~~ yesterday. This adds missing test
for it. #8581
  • Loading branch information
kyledurand authored Mar 8, 2023
1 parent 1eb0b06 commit c68c14d
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -939,7 +939,7 @@ describe('<ResourceList />', () => {
});

describe('BulkActions', () => {
it('renders on initial load when items are selected', () => {
it('renders on initial load when items are selected and bulkActions are present', () => {
const resourceList = mountWithApp(
<ResourceList
items={singleItemWithID}
Expand All @@ -951,6 +951,18 @@ describe('<ResourceList />', () => {
expect(resourceList).toContainReactComponentTimes(BulkActions, 1);
});

it('renders on initial load when items are selected and promotedBulkActions are present', () => {
const resourceList = mountWithApp(
<ResourceList
items={singleItemWithID}
renderItem={renderItem}
promotedBulkActions={promotedBulkActions}
selectedItems={['1']}
/>,
);
expect(resourceList).toContainReactComponentTimes(BulkActions, 1);
});

it('enables select mode when items are programmatically selected', () => {
const resourceList = mountWithApp(
<ResourceList
Expand Down

0 comments on commit c68c14d

Please sign in to comment.