diff --git a/src/uploader/index.js b/src/uploader/index.js
index baa2d9821..3a540e796 100644
--- a/src/uploader/index.js
+++ b/src/uploader/index.js
@@ -404,7 +404,7 @@ export default createComponent({
},
genUpload() {
- if (this.fileList.length >= this.maxCount || !this.showUpload) {
+ if (this.fileList.length >= this.maxCount) {
return;
}
@@ -446,6 +446,7 @@ export default createComponent({
return (
{
test('show-upload prop', () => {
const wrapper = mount(Uploader);
- expect(wrapper.contains('.van-uploader__upload')).toBeTruthy();
+
+ const upload = wrapper.find('.van-uploader__upload');
+ expect(upload.element).toBeTruthy();
wrapper.setProps({ showUpload: false });
- expect(wrapper.contains('.van-uploader__upload')).toBeFalsy();
+ expect(upload.element.style.display).toBe('none');
});
test('file message should be reactive', (done) => {