Skip to content

Commit 3ca91c5

Browse files
committed
fix
1 parent 44074e4 commit 3ca91c5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/attribute-editor/__tests__/warnings.test.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ import { warnOnce } from '@cloudscape-design/component-toolkit/internal';
77

88
import AttributeEditor from '../../../lib/components/attribute-editor';
99

10+
jest.mock('@cloudscape-design/component-toolkit', () => ({
11+
...jest.requireActual('@cloudscape-design/component-toolkit'),
12+
useContainerQuery: jest.fn().mockImplementation(() => ['m', () => {}]),
13+
}));
14+
1015
jest.mock('@cloudscape-design/component-toolkit/internal', () => ({
1116
...jest.requireActual('@cloudscape-design/component-toolkit/internal'),
1217
warnOnce: jest.fn(),
@@ -39,6 +44,7 @@ describe('AttributeEditor component', () => {
3944
/>
4045
);
4146

47+
expect(warnOnce).toHaveBeenCalledTimes(1);
4248
expect(warnOnce).toHaveBeenCalledWith(
4349
'AttributeEditor',
4450
'A `label` should be provided for each field definition. It is used as `aria-label` for accessibility.'

0 commit comments

Comments
 (0)