diff --git a/components/modal/__tests__/confirm.test.tsx b/components/modal/__tests__/confirm.test.tsx index 49c6fe2217..e696b9fe1d 100644 --- a/components/modal/__tests__/confirm.test.tsx +++ b/components/modal/__tests__/confirm.test.tsx @@ -283,6 +283,8 @@ describe('Modal.confirm triggers callbacks correctly', () => { jest.useFakeTimers(); const onCancel = jest.fn(); Modal.confirm({ + // test legacy visible + visible: true, title: 'title', content: 'content', onCancel, diff --git a/package.json b/package.json index 195f9c1bcd..cab91fc07c 100644 --- a/package.json +++ b/package.json @@ -187,7 +187,7 @@ "@types/warning": "^3.0.0", "@typescript-eslint/eslint-plugin": "^5.0.0", "@typescript-eslint/parser": "^5.0.0", - "antd-img-crop": "^4.0.0", + "antd-img-crop": "4.2.5", "array-move": "^4.0.0", "babel-plugin-add-react-displayname": "^0.0.5", "bisheng": "^3.7.0-alpha.4", diff --git a/tests/setup.js b/tests/setup.js index f230185718..afd91cdbfe 100644 --- a/tests/setup.js +++ b/tests/setup.js @@ -15,6 +15,8 @@ if (typeof window !== 'undefined') { // ref: https://github.com/ant-design/ant-design/issues/18774 if (!window.matchMedia) { Object.defineProperty(global.window, 'matchMedia', { + writable: true, + configurable: true, value: jest.fn(query => ({ matches: query.includes('max-width'), addListener: jest.fn(),