From 3be4388453548b1cbe7549e656176c885b8ea87e Mon Sep 17 00:00:00 2001 From: Corban Riley Date: Thu, 9 Jan 2025 12:40:28 -0500 Subject: [PATCH] Adding test to ensure all icons are in a 20x20 viewBox and fixing icons which didnt match --- public/static/icons/HomeIcon.svg | 2 +- public/static/icons/WalletConnectIcon.svg | 4 ++-- src/icons/HomeIcon.tsx | 2 +- src/icons/Icon.test.tsx | 14 ++++++++++++++ src/icons/WalletConnectIcon.tsx | 4 ++-- 5 files changed, 20 insertions(+), 6 deletions(-) diff --git a/public/static/icons/HomeIcon.svg b/public/static/icons/HomeIcon.svg index 80e76270a..ec57dbc66 100644 --- a/public/static/icons/HomeIcon.svg +++ b/public/static/icons/HomeIcon.svg @@ -1,3 +1,3 @@ - + diff --git a/public/static/icons/WalletConnectIcon.svg b/public/static/icons/WalletConnectIcon.svg index 38e4fae1d..813a537c2 100644 --- a/public/static/icons/WalletConnectIcon.svg +++ b/public/static/icons/WalletConnectIcon.svg @@ -1,3 +1,3 @@ - - + + diff --git a/src/icons/HomeIcon.tsx b/src/icons/HomeIcon.tsx index a9726aff4..42c36da8c 100644 --- a/src/icons/HomeIcon.tsx +++ b/src/icons/HomeIcon.tsx @@ -11,7 +11,7 @@ const Svg = (props: SVGProps) => ( { afterEach(cleanup) @@ -11,4 +13,16 @@ describe('Icons', () => { expect(el?.getAttribute('viewBox')).toBe('0 0 20 20') }) + + it('have a 20x20 viewBox', () => { + for (const [key, Icon] of Object.entries(icons)) { + const { container } = render() + const el = container.querySelector('svg') + + expect( + el?.getAttribute('viewBox'), + `${key} does not have a 20x20 viewBox` + ).toBe('0 0 20 20') + } + }) }) diff --git a/src/icons/WalletConnectIcon.tsx b/src/icons/WalletConnectIcon.tsx index bdfd8b8ec..3ec93f6cc 100644 --- a/src/icons/WalletConnectIcon.tsx +++ b/src/icons/WalletConnectIcon.tsx @@ -11,12 +11,12 @@ const Svg = (props: SVGProps) => ( )