Skip to content

Commit c68c14d

Browse files
authored
[ResourceList] Add test to prevent future regression (#8589)
Shipped a hotfix in a hurry ~~today~~ yesterday. This adds missing test for it. #8581
1 parent 1eb0b06 commit c68c14d

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

polaris-react/src/components/ResourceList/tests/ResourceList.test.tsx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -939,7 +939,7 @@ describe('<ResourceList />', () => {
939939
});
940940

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

954+
it('renders on initial load when items are selected and promotedBulkActions are present', () => {
955+
const resourceList = mountWithApp(
956+
<ResourceList
957+
items={singleItemWithID}
958+
renderItem={renderItem}
959+
promotedBulkActions={promotedBulkActions}
960+
selectedItems={['1']}
961+
/>,
962+
);
963+
expect(resourceList).toContainReactComponentTimes(BulkActions, 1);
964+
});
965+
954966
it('enables select mode when items are programmatically selected', () => {
955967
const resourceList = mountWithApp(
956968
<ResourceList

0 commit comments

Comments
 (0)