From af46975f564fdd293803fcecce039744327d0537 Mon Sep 17 00:00:00 2001 From: tangjinzhou <415800467@qq.com> Date: Sat, 24 Oct 2020 21:15:55 +0800 Subject: [PATCH] test: udpate date-picker & drawer snap --- .../__tests__/__snapshots__/demo.test.js.snap | 30 +++++++++---------- components/divider/index.tsx | 4 ++- .../__tests__/__snapshots__/demo.test.js.snap | 4 +-- 3 files changed, 20 insertions(+), 18 deletions(-) diff --git a/components/date-picker/__tests__/__snapshots__/demo.test.js.snap b/components/date-picker/__tests__/__snapshots__/demo.test.js.snap index 9204ff3e8..46e468ed4 100644 --- a/components/date-picker/__tests__/__snapshots__/demo.test.js.snap +++ b/components/date-picker/__tests__/__snapshots__/demo.test.js.snap @@ -1,60 +1,60 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`renders ./antdv-demo/docs/date-picker/demo/basic.md correctly 1`] = ` - ~ + ~ `; exports[`renders ./antdv-demo/docs/date-picker/demo/date-render.md correctly 1`] = ` - ~ + ~ `; exports[`renders ./antdv-demo/docs/date-picker/demo/disabled.md correctly 1`] = ` - ~ + ~ `; exports[`renders ./antdv-demo/docs/date-picker/demo/disabled-date.md correctly 1`] = ` - ~ + ~ `; exports[`renders ./antdv-demo/docs/date-picker/demo/extra-footer.md correctly 1`] = ` - ~ - ~ + ~ + ~ `; -exports[`renders ./antdv-demo/docs/date-picker/demo/format.md correctly 1`] = ` ~ `; +exports[`renders ./antdv-demo/docs/date-picker/demo/format.md correctly 1`] = ` ~ `; exports[`renders ./antdv-demo/docs/date-picker/demo/mode.md correctly 1`] = ` - ~ + ~ `; exports[`renders ./antdv-demo/docs/date-picker/demo/presetted-ranges.md correctly 1`] = ` - ~ - ~ + ~ + ~ `; exports[`renders ./antdv-demo/docs/date-picker/demo/size.md correctly 1`] = ` - Large Default Small ~ + Large Default Small ~ `; exports[`renders ./antdv-demo/docs/date-picker/demo/start-end.md correctly 1`] = ``; exports[`renders ./antdv-demo/docs/date-picker/demo/suffix.md correctly 1`] = ` - ~ -abab ~ + ~ +abab ~ abab `; -exports[`renders ./antdv-demo/docs/date-picker/demo/text.md correctly 1`] = `SelectTime请选择`; +exports[`renders ./antdv-demo/docs/date-picker/demo/text.md correctly 1`] = `SelectTime请选择`; exports[`renders ./antdv-demo/docs/date-picker/demo/time.md correctly 1`] = ` - ~ + ~ `; diff --git a/components/divider/index.tsx b/components/divider/index.tsx index a45795c69..d8816cb17 100644 --- a/components/divider/index.tsx +++ b/components/divider/index.tsx @@ -1,3 +1,4 @@ +import { flattenChildren } from '../_util/props-util'; import { App, computed, defineComponent, inject, PropType } from 'vue'; import { defaultConfigProvider } from '../config-provider'; @@ -35,9 +36,10 @@ const Divider = defineComponent({ }); return () => { + const children = flattenChildren(slots.default?.()); return ( - {slots.default?.()} + {children.length ? {children} : null} ); }; diff --git a/components/drawer/__tests__/__snapshots__/demo.test.js.snap b/components/drawer/__tests__/__snapshots__/demo.test.js.snap index 172893f8c..eb0fc5aab 100644 --- a/components/drawer/__tests__/__snapshots__/demo.test.js.snap +++ b/components/drawer/__tests__/__snapshots__/demo.test.js.snap @@ -64,7 +64,7 @@ exports[`renders ./antdv-demo/docs/drawer/demo/user-profile.md correctly 1`] = ` - + Lily Progresser XTech @@ -79,7 +79,7 @@ exports[`renders ./antdv-demo/docs/drawer/demo/user-profile.md correctly 1`] = ` - + Lily Progresser XTech