diff --git a/UNRELEASED.md b/UNRELEASED.md
index c9f71570bef..be6f7362a56 100644
--- a/UNRELEASED.md
+++ b/UNRELEASED.md
@@ -17,6 +17,7 @@ Use [the changelog guidelines](https://git.io/polaris-changelog-guidelines) to f
- Fixed vertical alignment of Tabs disclosure activator ([#2087](https://github.com/Shopify/polaris-react/pull/2087))
- Fixed `Modal` setting an invalid `id` on `aria-labelledby` when no `title` is set ([#2115](https://github.com/Shopify/polaris-react/pull/2115))
+- Fixed error warnings in `Card` and `RollupActions` tests ([#2125](https://github.com/Shopify/polaris-react/pull/2125))
### Documentation
diff --git a/src/components/ActionMenu/components/RollupActions/tests/RollupActions.test.tsx b/src/components/ActionMenu/components/RollupActions/tests/RollupActions.test.tsx
index a1db3f9e5b9..ace7e188f0b 100644
--- a/src/components/ActionMenu/components/RollupActions/tests/RollupActions.test.tsx
+++ b/src/components/ActionMenu/components/RollupActions/tests/RollupActions.test.tsx
@@ -1,7 +1,7 @@
import React from 'react';
import {ReactWrapper} from 'enzyme';
import {HorizontalDotsMinor} from '@shopify/polaris-icons';
-import {mountWithAppProvider, trigger} from 'test-utilities/legacy';
+import {mountWithAppProvider, trigger, act} from 'test-utilities/legacy';
import {Button, Popover} from 'components';
@@ -60,7 +60,10 @@ describe('', () => {
expect(popoverComponent.prop('active')).toBe(true);
const firstActionListItem = wrapper.find(ActionListItem).first();
- trigger(firstActionListItem, 'onAction');
+ act(() => {
+ trigger(firstActionListItem, 'onAction');
+ });
+ popoverComponent.update();
popoverComponent = wrapper.find(Popover);
expect(popoverComponent.prop('active')).toBe(false);
@@ -107,5 +110,8 @@ function findPopoverActivator(wrapper: Wrapper) {
function activatePopover(wrapper: Wrapper) {
const activator = findPopoverActivator(wrapper);
- trigger(activator, 'onClick');
+ act(() => {
+ trigger(activator, 'onClick');
+ });
+ wrapper.update();
}
diff --git a/src/components/Card/tests/Card.test.tsx b/src/components/Card/tests/Card.test.tsx
index f2c492201a2..957b7fba6c8 100644
--- a/src/components/Card/tests/Card.test.tsx
+++ b/src/components/Card/tests/Card.test.tsx
@@ -3,6 +3,7 @@ import {
mountWithAppProvider,
trigger,
findByTestID,
+ act,
} from 'test-utilities/legacy';
import {Card, Badge, Button, Popover, ActionList} from 'components';
import {WithinContentContext} from '../../../utilities/within-content-context';
@@ -140,8 +141,10 @@ describe('', () => {
expect(popover).toHaveLength(1);
expect(popover.prop('active')).toBe(false);
- trigger(disclosureButton, 'onClick');
-
+ act(() => {
+ trigger(disclosureButton, 'onClick');
+ });
+ card.update();
expect(
card
.find(Popover)