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
parent
commit
630c24aa79
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      components/modal/__tests__/confirm.test.tsx
  2. 2
      package.json
  3. 2
      tests/setup.js

2
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,

2
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",

2
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(),

Loading…
Cancel
Save