diff --git a/docs/src/asserts/Logo.sketch b/docs/assets/logo.sketch similarity index 100% rename from docs/src/asserts/Logo.sketch rename to docs/assets/logo.sketch diff --git a/packages/info/index.tsx b/packages/info/index.tsx index a6c6b2373..9f9421bb9 100644 --- a/packages/info/index.tsx +++ b/packages/info/index.tsx @@ -17,7 +17,7 @@ function Info( slots: DefaultSlots, ctx: RenderContext ) { - if (!isDef(props.info)) { + if (!isDef(props.info) || props.info === '') { return; } diff --git a/packages/info/test/__snapshots__/index.spec.js.snap b/packages/info/test/__snapshots__/index.spec.js.snap new file mode 100644 index 000000000..84b187992 --- /dev/null +++ b/packages/info/test/__snapshots__/index.spec.js.snap @@ -0,0 +1,7 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`should not render when info is empty string 1`] = ``; + +exports[`should not render when info is empty undefined 1`] = ``; + +exports[`should render when info is zero 1`] = `
0
`; diff --git a/packages/info/test/index.spec.js b/packages/info/test/index.spec.js new file mode 100644 index 000000000..e7d35db2c --- /dev/null +++ b/packages/info/test/index.spec.js @@ -0,0 +1,32 @@ +import Info from '..'; +import { mount } from '../../../test/utils'; + +test('should not render when info is empty string', () => { + const wrapper = mount(Info, { + propsData: { + info: '' + } + }); + + expect(wrapper).toMatchSnapshot(); +}); + +test('should not render when info is empty undefined', () => { + const wrapper = mount(Info, { + propsData: { + info: undefined + } + }); + + expect(wrapper).toMatchSnapshot(); +}); + +test('should render when info is zero', () => { + const wrapper = mount(Info, { + propsData: { + info: 0 + } + }); + + expect(wrapper).toMatchSnapshot(); +}); diff --git a/packages/uploader/index.less b/packages/uploader/index.less index ec677e783..a3bd533f2 100644 --- a/packages/uploader/index.less +++ b/packages/uploader/index.less @@ -10,6 +10,7 @@ left: 0; width: 100%; height: 100%; + overflow: hidden; // to clip file-upload-button cursor: pointer; opacity: 0; }