From 2532efc9c58b21a8cf16617ea58fc5613d251260 Mon Sep 17 00:00:00 2001 From: Robert Kuykendall Date: Thu, 2 Mar 2023 11:26:00 -0600 Subject: [PATCH 1/2] Add data-only test for pickAttrs This use case is used in both rc-dialog and soon in rc-drawer --- tests/utils.test.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/utils.test.js b/tests/utils.test.js index f6112df3..da0b9712 100644 --- a/tests/utils.test.js +++ b/tests/utils.test.js @@ -141,4 +141,10 @@ describe('utils', () => { }); }); }); + + it('data only', () => { + expect(pickAttrs(originProps, { data: true })).toEqual({ + 'data-my': 1, + }); + }); }); From ee29b9f1cab2582124c5a782ce4df23d405981d2 Mon Sep 17 00:00:00 2001 From: Robert Kuykendall Date: Thu, 2 Mar 2023 11:32:13 -0600 Subject: [PATCH 2/2] Fix nesting --- tests/utils.test.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/utils.test.js b/tests/utils.test.js index da0b9712..926c25c4 100644 --- a/tests/utils.test.js +++ b/tests/utils.test.js @@ -140,11 +140,11 @@ describe('utils', () => { role: 'button', }); }); - }); - - it('data only', () => { - expect(pickAttrs(originProps, { data: true })).toEqual({ - 'data-my': 1, + + it('data only', () => { + expect(pickAttrs(originProps, { data: true })).toEqual({ + 'data-my': 1, + }); }); - }); + }); });