From 0ab504bb75c53ee10556f724f524e990b01e5265 Mon Sep 17 00:00:00 2001 From: Constance Chen Date: Thu, 3 Nov 2022 11:57:48 -0700 Subject: [PATCH 1/7] [REVERT ME] Repro/testing --- src-docs/src/views/card/card_image.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src-docs/src/views/card/card_image.tsx b/src-docs/src/views/card/card_image.tsx index 4f420364351..350152eb1c1 100644 --- a/src-docs/src/views/card/card_image.tsx +++ b/src-docs/src/views/card/card_image.tsx @@ -5,7 +5,7 @@ import { EuiCard, EuiFlexGroup, EuiFlexItem, - EuiIcon, + EuiAvatar, } from '../../../../src'; export default () => ( @@ -46,7 +46,7 @@ export default () => ( textAlign="left" href="https://elastic.github.io/eui/" image="https://source.unsplash.com/400x200/?City" - icon={} + icon={} title={'Beats in the City'} description="This card has an href and should be a link." /> From 2aba0776cd7a4ff47e65844c68bd695a17de4a8c Mon Sep 17 00:00:00 2001 From: Constance Chen Date: Thu, 3 Nov 2022 12:01:23 -0700 Subject: [PATCH 2/7] Example of failing cloned CSS - note missing euiAvatar classes in `emotion-euiCard__icon` --- .../card/__snapshots__/card.test.tsx.snap | 45 +++++++++++++++++++ src/components/card/card.test.tsx | 15 ++++++- 2 files changed, 58 insertions(+), 2 deletions(-) diff --git a/src/components/card/__snapshots__/card.test.tsx.snap b/src/components/card/__snapshots__/card.test.tsx.snap index b4b0c78314b..14566327825 100644 --- a/src/components/card/__snapshots__/card.test.tsx.snap +++ b/src/components/card/__snapshots__/card.test.tsx.snap @@ -177,6 +177,51 @@ exports[`EuiCard props accepts div props like style 1`] = ` `; +exports[`EuiCard props an avatar icon 1`] = ` +
+
+ +
+
+

+ + Card title + +

+
+

+ Card description +

+
+
+
+`; + exports[`EuiCard props children 1`] = `
{ @@ -48,6 +47,18 @@ describe('EuiCard', () => { expect(component).toMatchSnapshot(); }); + test('an avatar icon', () => { + const component = render( + } + /> + ); + + expect(component).toMatchSnapshot(); + }); + test('a null icon', () => { const component = render( Date: Thu, 3 Nov 2022 12:03:59 -0700 Subject: [PATCH 3/7] Fix EuiCard icons not correctly merging `css` --- src/components/card/__snapshots__/card.test.tsx.snap | 2 +- src/components/card/card.tsx | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/card/__snapshots__/card.test.tsx.snap b/src/components/card/__snapshots__/card.test.tsx.snap index 14566327825..c4c0ee1fae4 100644 --- a/src/components/card/__snapshots__/card.test.tsx.snap +++ b/src/components/card/__snapshots__/card.test.tsx.snap @@ -186,7 +186,7 @@ exports[`EuiCard props an avatar icon 1`] = ` >