diff --git a/components/upload/__tests__/index-spec.js b/components/upload/__tests__/index-spec.js index 74b03d336d..4f91ccf1d4 100644 --- a/components/upload/__tests__/index-spec.js +++ b/components/upload/__tests__/index-spec.js @@ -1,12 +1,11 @@ import React from 'react'; -import ReactDOM from 'react-dom'; -import Enzyme, { shallow, mount } from 'enzyme'; +import Enzyme, { mount } from 'enzyme'; import Adapter from 'enzyme-adapter-react-16'; import assert from 'power-assert'; import sinon from 'sinon'; import Upload from '../index'; import request from '../runtime/request'; -import { func } from '../../util'; +import '../style'; Enzyme.configure({ adapter: new Adapter() }); @@ -187,6 +186,34 @@ describe('Upload', () => { done(); }); + // issue: Shell phone model menu icon should hidde, close #3886 + it('should hidden upload Dragger when file length === limit', done => { + const drag = document.createElement('div'); + document.body.appendChild(drag); + mount( + , + {attachTo: drag} + ); + assert(document.querySelectorAll('.next-upload-drag').length === 1); + const uploadInner = document.querySelectorAll('.next-upload-inner'); + assert(uploadInner.length === 1 ) + assert(uploadInner[0].offsetHeight === 0); + done(); + }); }); describe('[behavior] Upload Request', () => { diff --git a/components/upload/main.scss b/components/upload/main.scss index 929aa64b2d..b3a674a964 100644 --- a/components/upload/main.scss +++ b/components/upload/main.scss @@ -488,6 +488,9 @@ #{$upload-prefix}-dragable { #{$upload-prefix}-inner { display: block; + &.#{$css-prefix}hidden { + display: none; + } } #{$upload-prefix}-drag {