mirror of
https://github.com/ant-design/ant-design.git
synced 2025-06-11 19:42:54 +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', () => {
|
||||
const warnSpy = jest.spyOn(console, 'warn').mockImplementation(() => {});
|
||||
const invalidateTime = moment('I AM INVALIDATE');
|
||||
warnSpy.mockReset();
|
||||
|
||||
it('defaultValue', () => {
|
||||
mount(<DatePicker defaultValue={invalidateTime} />);
|
||||
|
@ -1,19 +1,22 @@
|
||||
import React from 'react';
|
||||
import { mount, render } from 'enzyme';
|
||||
import debounce from 'lodash/debounce';
|
||||
import Tree from '../index';
|
||||
|
||||
const { DirectoryTree, TreeNode } = Tree;
|
||||
|
||||
const mockDebounce = jest.mock('lodash/debounce', () => fn => fn);
|
||||
jest.mock('lodash/debounce');
|
||||
|
||||
describe('Directory Tree', () => {
|
||||
debounce.mockImplementation(fn => fn);
|
||||
|
||||
beforeAll(() => {
|
||||
jest.useFakeTimers();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
jest.useRealTimers();
|
||||
mockDebounce.mockRestore();
|
||||
debounce.mockRestore();
|
||||
});
|
||||
|
||||
function createTree(props) {
|
||||
|
Loading…
Reference in New Issue
Block a user