Browse Source
test: raise test covarage (#38027)
* test: raise test covarage
* chore: code clean
* chore: lock jest-dom to v28
* chore: lock jest-dom
* test: update setup
pull/38041/head
MadCcc
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
5 additions and
1 deletions
-
components/modal/__tests__/confirm.test.tsx
-
package.json
-
tests/setup.js
|
|
@ -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, |
|
|
|
|
|
@ -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", |
|
|
|
|
|
@ -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(), |
|
|
|