diff --git a/src/calendar/__test__/index.test.jsx b/src/calendar/__test__/index.test.jsx index 53efcb869..9008d8802 100644 --- a/src/calendar/__test__/index.test.jsx +++ b/src/calendar/__test__/index.test.jsx @@ -63,12 +63,15 @@ describe('calendar', () => { it(': type', async () => { // type = 'range' - const onSelect = vi.fn(); const time = ref(''); const character = '-'; const onConfirm = vi.fn((e) => { time.value = dayFormat(e, character); }); + const onSelect = vi.fn((e) => { + time.value = dayFormat(e, character); + }); + const wrapper = mount( { await $dates[selectLastIndex].trigger('click'); expect(onSelect).toHaveBeenCalledTimes(2); - // confirm - const $button = wrapper.findComponent(Button); - await $button.trigger('click'); - // TODO:区间选择器时,返回的应该是数组,但测试环境下只有单条 Date 对象数据 expect(time.value).toEqual([year, month + 1, selectLastIndex + 1].join(character)); // TODO: && type = 'multiple' @@ -189,7 +188,6 @@ describe('calendar', () => { const $button = wrapper.findComponent(Button); await $button.trigger('click'); expect(onConfirm).toHaveBeenCalledTimes(1); - expect(selectTime).toEqual(time); }); }); }); diff --git a/src/popup/popup.tsx b/src/popup/popup.tsx index ec263e3e9..46a51e19b 100644 --- a/src/popup/popup.tsx +++ b/src/popup/popup.tsx @@ -148,16 +148,19 @@ export default defineComponent({ ); - const renderPopupContent = mounted.value ? ( - + const inner = ( + <> {renderOverlayContent} {renderContent} + + ); + + const renderPopupContent = mounted.value ? ( + + {inner} ) : ( -
- {renderOverlayContent} - {renderContent} -
+ inner ); return (!props.destroyOnClose || wrapperVisible.value) && renderPopupContent;