From f7890233beefbb8ab85af1c0d377ff4fbaa70a1f Mon Sep 17 00:00:00 2001 From: dengfuping Date: Wed, 10 Jul 2024 20:13:47 +0800 Subject: [PATCH] fix(design): Table default empty should work --- .../__snapshots__/index.test.tsx.snap | 117 ++++++++++++++++++ .../design/src/table/__tests__/index.test.tsx | 7 ++ packages/design/src/table/index.tsx | 2 - 3 files changed, 124 insertions(+), 2 deletions(-) diff --git a/packages/design/src/table/__tests__/__snapshots__/index.test.tsx.snap b/packages/design/src/table/__tests__/__snapshots__/index.test.tsx.snap index 05531056f..9a49cddee 100644 --- a/packages/design/src/table/__tests__/__snapshots__/index.test.tsx.snap +++ b/packages/design/src/table/__tests__/__snapshots__/index.test.tsx.snap @@ -437,6 +437,123 @@ exports[`Table > ConfigProvider pagination should work 1`] = ` `; +exports[`Table > default empty should work 1`] = ` +
+
+
+
+
+
+ + + + + + + + + + + + + + +
+ Name + + Age + + Address +
+
+
+ + + Simple Empty + + + + + + + + + +
+
+ No data +
+
+
+
+
+
+
+
+
+`; + exports[`Table > default pagination should work 1`] = `
{ expect(asFragment().firstChild).toMatchSnapshot(); }); + it('default empty should work', () => { + const { container, asFragment } = render(); + expect(container.querySelector('.ant-empty-image')).toBeTruthy(); + expect(container.querySelector('.ant-empty-description')).toBeTruthy(); + expect(asFragment().firstChild).toMatchSnapshot(); + }); + it('ConfigProvider pagination should work', () => { const { container, asFragment } = render( (props: TableProps, ref: React.Ref) { const { getPrefixCls, locale, table } = useContext(ConfigProvider.ConfigContext); const { batchOperationBar, ...restLocale } = { - ...enUS.Table, - ...locale?.Table, ...customLocale, batchOperationBar: { ...enUS.Table?.batchOperationBar,