From fbb9fcee3cd46b5fbe05af51b15e2ac4e6ea2a9b Mon Sep 17 00:00:00 2001 From: Jorrit Tinholt Date: Fri, 24 Nov 2023 09:29:44 +0100 Subject: [PATCH 1/3] make social container element a span --- src/component.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/component.jsx b/src/component.jsx index 66b35a19..a62fbd16 100644 --- a/src/component.jsx +++ b/src/component.jsx @@ -113,7 +113,7 @@ export const SocialIcon = React.forwardRef(function SocialIcon(props, ref) { 'aria-label': ariaLabel, ref, }, -
+ -
, + , children, ) }) From 4d78ae967c2ebe4a5ce17d15023cc0e28d0d9870 Mon Sep 17 00:00:00 2001 From: Connor Couetil Date: Sun, 26 Nov 2023 10:33:25 -0500 Subject: [PATCH 2/3] add unit test asserting there is no div --- package.json | 2 +- test/unit/cases.js | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 79d8f254..c4886597 100644 --- a/package.json +++ b/package.json @@ -140,4 +140,4 @@ "react-dom": "^18.2.0" }, "packageManager": "pnpm@8.6.6" -} +} \ No newline at end of file diff --git a/test/unit/cases.js b/test/unit/cases.js index 1fcbbed6..89dbd4eb 100644 --- a/test/unit/cases.js +++ b/test/unit/cases.js @@ -313,4 +313,10 @@ export const cases = ({ SocialIcon, getKeys }) => ) }) } + + // from https://github.com/couetilc/react-social-icons/pull/236 + it('renders the svg within an inline element', ({ expect }) => { + render() + expect(link().querySelector('div')).toBeNull() + }); }) From fc66d4caa5776092bf83c3b0f49fcfe060c02e11 Mon Sep 17 00:00:00 2001 From: Connor Couetil Date: Sun, 26 Nov 2023 10:37:31 -0500 Subject: [PATCH 3/3] run formatting task --- test/unit/cases.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/unit/cases.js b/test/unit/cases.js index 89dbd4eb..4ae7d9d4 100644 --- a/test/unit/cases.js +++ b/test/unit/cases.js @@ -318,5 +318,5 @@ export const cases = ({ SocialIcon, getKeys }) => it('renders the svg within an inline element', ({ expect }) => { render() expect(link().querySelector('div')).toBeNull() - }); + }) })