ant-design/components/upload/__tests__/dragger.test.js
啸生 71b53b7175
master to feature (#19062)
*  increase upload test cov

* chore: replace resizeObserver with `rc-resize-observer` (#19057)

* replace resizeObserver with rc-resize-observer

* fix affix lint

* fix es lint

* changelog (#19056)

* Release 3.23.5
2019-09-30 10:31:36 +08:00

29 lines
794 B
JavaScript

/* eslint-disable react/no-string-refs, react/prefer-es6-class */
import React from 'react';
import { mount } from 'enzyme';
import Upload from '..';
import { setup, teardown } from './mock';
import mountTest from '../../../tests/shared/mountTest';
describe('Upload.Dragger', () => {
mountTest(Upload.Dragger);
beforeEach(() => setup());
afterEach(() => teardown());
it('support drag file with over style', () => {
const wrapper = mount(
<Upload.Dragger action="http://upload.com">
<div />
</Upload.Dragger>,
);
wrapper.find('.ant-upload-drag-container').simulate('dragover', {
target: {
files: [{ file: 'foo.png' }],
},
});
expect(wrapper.find('.ant-upload-drag').hasClass('ant-upload-drag-hover')).toBe(true);
});
});