From 1bc497f3b39ee76db5cf1be7e98f319e08f4904d Mon Sep 17 00:00:00 2001 From: neverland Date: Tue, 1 Jun 2021 19:22:50 +0800 Subject: [PATCH] feat(Popup): add overlay-content slot (#8794) --- src/calendar/test/prop.spec.ts | 2 +- src/popup/Popup.tsx | 1 + src/popup/README.md | 7 +++++++ src/popup/README.zh-CN.md | 7 +++++++ src/popup/test/__snapshots__/index.spec.js.snap | 12 ++++++++++++ src/popup/test/index.spec.js | 13 +++++++++++++ 6 files changed, 41 insertions(+), 1 deletion(-) diff --git a/src/calendar/test/prop.spec.ts b/src/calendar/test/prop.spec.ts index f85a3e5f0..d14ef4c1f 100644 --- a/src/calendar/test/prop.spec.ts +++ b/src/calendar/test/prop.spec.ts @@ -202,7 +202,7 @@ test('month-show event', async () => { show: true, }, }); - await later(100); + await later(200); expect(wrapper.emitted('month-show')).toBeTruthy(); }); diff --git a/src/popup/Popup.tsx b/src/popup/Popup.tsx index 80aff52ae..5a9062ebe 100644 --- a/src/popup/Popup.tsx +++ b/src/popup/Popup.tsx @@ -132,6 +132,7 @@ export default defineComponent({ if (props.overlay) { return ( `; + +exports[`should render overlay-content slot correctly 1`] = ` + +
+ Custom Overlay Content +
+
+ +
+
+
+`; diff --git a/src/popup/test/index.spec.js b/src/popup/test/index.spec.js index 6e9dd78ba..b914ab1f3 100644 --- a/src/popup/test/index.spec.js +++ b/src/popup/test/index.spec.js @@ -201,3 +201,16 @@ test('should change icon class prefix when using icon-prefix prop', () => { expect(wrapper.html()).toMatchSnapshot(); }); + +test('should render overlay-content slot correctly', () => { + const wrapper = mount(Popup, { + props: { + show: true, + }, + slots: { + 'overlay-content': () => 'Custom Overlay Content', + }, + }); + + expect(wrapper.html()).toMatchSnapshot(); +});