mirror of
https://github.com/ant-design/ant-design.git
synced 2025-07-26 00:26:53 +08:00
another try (#16077)
This commit is contained in:
parent
321a12eb6c
commit
15b900bbfb
@ -219,7 +219,9 @@ describe('DatePicker', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe('warning use if use invalidate moment', () => {
|
describe('warning use if use invalidate moment', () => {
|
||||||
|
const warnSpy = jest.spyOn(console, 'warn').mockImplementation(() => {});
|
||||||
const invalidateTime = moment('I AM INVALIDATE');
|
const invalidateTime = moment('I AM INVALIDATE');
|
||||||
|
warnSpy.mockReset();
|
||||||
|
|
||||||
it('defaultValue', () => {
|
it('defaultValue', () => {
|
||||||
mount(<DatePicker defaultValue={invalidateTime} />);
|
mount(<DatePicker defaultValue={invalidateTime} />);
|
||||||
|
@ -1,19 +1,22 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { mount, render } from 'enzyme';
|
import { mount, render } from 'enzyme';
|
||||||
|
import debounce from 'lodash/debounce';
|
||||||
import Tree from '../index';
|
import Tree from '../index';
|
||||||
|
|
||||||
const { DirectoryTree, TreeNode } = Tree;
|
const { DirectoryTree, TreeNode } = Tree;
|
||||||
|
|
||||||
const mockDebounce = jest.mock('lodash/debounce', () => fn => fn);
|
jest.mock('lodash/debounce');
|
||||||
|
|
||||||
describe('Directory Tree', () => {
|
describe('Directory Tree', () => {
|
||||||
|
debounce.mockImplementation(fn => fn);
|
||||||
|
|
||||||
beforeAll(() => {
|
beforeAll(() => {
|
||||||
jest.useFakeTimers();
|
jest.useFakeTimers();
|
||||||
});
|
});
|
||||||
|
|
||||||
afterAll(() => {
|
afterAll(() => {
|
||||||
jest.useRealTimers();
|
jest.useRealTimers();
|
||||||
mockDebounce.mockRestore();
|
debounce.mockRestore();
|
||||||
});
|
});
|
||||||
|
|
||||||
function createTree(props) {
|
function createTree(props) {
|
||||||
|
Loading…
Reference in New Issue
Block a user