From 8e85bdbcdc158439eb73ed1dacccc157af43b422 Mon Sep 17 00:00:00 2001 From: Anders Date: Wed, 28 Sep 2022 09:38:11 +0200 Subject: [PATCH] chore(Icon): replace data-test-id with data-testid (#1583) --- .../__snapshots__/Accordion.test.js.snap | 2 +- .../__tests__/Autocomplete.test.js | 4 +- .../avatar/__tests__/Avatar.test.tsx | 4 +- .../components/badge/__tests__/Badge.test.tsx | 6 +- .../breadcrumb/__tests__/Breadcrumb.test.tsx | 10 +- .../__snapshots__/Button.test.js.snap | 26 ++-- .../__snapshots__/DatePicker.test.js.snap | 10 +- .../__snapshots__/Dialog.test.tsx.snap | 24 +-- .../__snapshots__/Drawer.test.tsx.snap | 24 +-- .../dropdown/__tests__/Dropdown.test.js | 4 +- .../__snapshots__/GlobalError.test.js.snap | 8 +- .../__snapshots__/GlobalStatus.test.js.snap | 4 +- .../help-button/__tests__/HelpButton.test.tsx | 6 +- .../__snapshots__/IconPrimary.test.js.snap | 2 +- .../dnb-eufemia/src/components/icon/Icon.js | 2 +- .../info-card/__tests__/InfoCard.test.tsx | 7 +- .../__snapshots__/Input.test.js.snap | 2 +- .../__snapshots__/InputPassword.test.js.snap | 2 +- .../__snapshots__/Modal.test.tsx.snap | 24 +-- .../pagination/__tests__/Pagination.test.js | 2 +- .../__snapshots__/Pagination.test.js.snap | 4 +- .../__snapshots__/StepIndicator.test.js.snap | 144 +++++++++--------- .../__tests__/__snapshots__/Tabs.test.js.snap | 8 +- .../dnb-eufemia/src/components/tag/Tag.tsx | 9 +- .../src/components/tag/__tests__/Tag.test.tsx | 5 +- .../timeline/__tests__/Timeline.test.tsx | 7 +- .../dnb-eufemia/src/shared/locales/en-GB.js | 3 + .../dnb-eufemia/src/shared/locales/nb-NO.js | 3 + 28 files changed, 178 insertions(+), 178 deletions(-) diff --git a/packages/dnb-eufemia/src/components/accordion/__tests__/__snapshots__/Accordion.test.js.snap b/packages/dnb-eufemia/src/components/accordion/__tests__/__snapshots__/Accordion.test.js.snap index 771c91d2d59..3c981410802 100644 --- a/packages/dnb-eufemia/src/components/accordion/__tests__/__snapshots__/Accordion.test.js.snap +++ b/packages/dnb-eufemia/src/components/accordion/__tests__/__snapshots__/Accordion.test.js.snap @@ -92,7 +92,7 @@ exports[`Accordion component have to match snapshot 1`] = ` diff --git a/packages/dnb-eufemia/src/components/autocomplete/__tests__/Autocomplete.test.js b/packages/dnb-eufemia/src/components/autocomplete/__tests__/Autocomplete.test.js index b549ac2fac7..cbc2ffa6fcd 100644 --- a/packages/dnb-eufemia/src/components/autocomplete/__tests__/Autocomplete.test.js +++ b/packages/dnb-eufemia/src/components/autocomplete/__tests__/Autocomplete.test.js @@ -1820,7 +1820,7 @@ describe('Autocomplete component', () => { .not('.dnb-input__clear-button') .find('.dnb-icon') .instance() - .getAttribute('data-test-id') + .getAttribute('data-testid') ).toContain('chevron down') }) @@ -1971,7 +1971,7 @@ describe('Autocomplete component', () => { .not('.dnb-input__clear-button') .find('.dnb-icon') .instance() - .getAttribute('data-test-id') + .getAttribute('data-testid') ).toContain('bell') }) diff --git a/packages/dnb-eufemia/src/components/avatar/__tests__/Avatar.test.tsx b/packages/dnb-eufemia/src/components/avatar/__tests__/Avatar.test.tsx index a033b348059..76c8286db69 100644 --- a/packages/dnb-eufemia/src/components/avatar/__tests__/Avatar.test.tsx +++ b/packages/dnb-eufemia/src/components/avatar/__tests__/Avatar.test.tsx @@ -59,13 +59,13 @@ describe('Avatar', () => { render( - + ) const avatar = screen.queryByTestId('avatar') - expect(within(avatar).queryByTestId('confetti-icon')).not.toBeNull() + expect(within(avatar).queryByTestId('confetti icon')).not.toBeNull() expect(screen.queryByTestId('avatar-label')).toBeNull() }) diff --git a/packages/dnb-eufemia/src/components/badge/__tests__/Badge.test.tsx b/packages/dnb-eufemia/src/components/badge/__tests__/Badge.test.tsx index 02df04b2f32..b44addfa8d6 100644 --- a/packages/dnb-eufemia/src/components/badge/__tests__/Badge.test.tsx +++ b/packages/dnb-eufemia/src/components/badge/__tests__/Badge.test.tsx @@ -69,9 +69,7 @@ describe('Badge', () => { it('renders children as content', () => { render( - } - > + }> A @@ -79,7 +77,7 @@ describe('Badge', () => { ) const badgeRoot = screen.queryByTestId('badge-root') - expect(within(badgeRoot).queryByTestId('confetti-icon')).not.toBeNull() + expect(within(badgeRoot).queryByTestId('confetti icon')).not.toBeNull() }) it('warns when notification badge content is a string', () => { diff --git a/packages/dnb-eufemia/src/components/breadcrumb/__tests__/Breadcrumb.test.tsx b/packages/dnb-eufemia/src/components/breadcrumb/__tests__/Breadcrumb.test.tsx index aecbd9e65b3..497e84c4a32 100644 --- a/packages/dnb-eufemia/src/components/breadcrumb/__tests__/Breadcrumb.test.tsx +++ b/packages/dnb-eufemia/src/components/breadcrumb/__tests__/Breadcrumb.test.tsx @@ -196,17 +196,11 @@ describe('Breadcrumb', () => { }) it('will render custom icon', () => { - const CustomIcon = ( - - ) + const CustomIcon = render() - const element = screen.queryByTestId('breadcrumb-item-custom-icon') + const element = screen.queryByTestId('bell icon') expect(element).not.toBeNull() - expect(element.getAttribute('data-test-id')).toBe('bell icon') }) it('renders a skeleton if skeleton is true', () => { diff --git a/packages/dnb-eufemia/src/components/button/__tests__/__snapshots__/Button.test.js.snap b/packages/dnb-eufemia/src/components/button/__tests__/__snapshots__/Button.test.js.snap index 31076d942e8..16f2163e4e1 100644 --- a/packages/dnb-eufemia/src/components/button/__tests__/__snapshots__/Button.test.js.snap +++ b/packages/dnb-eufemia/src/components/button/__tests__/__snapshots__/Button.test.js.snap @@ -38,7 +38,7 @@ exports[`Button component have to match default button snapshot 1`] = `