From 3b3d91e559bfe4ef052ae9309dea3f54aa9dcc78 Mon Sep 17 00:00:00 2001 From: Braden MacDonald Date: Wed, 13 Mar 2024 11:19:33 -0700 Subject: [PATCH] fix: types still weren't correct --- src/Icon/Icon.test.tsx | 8 ++++++++ src/Icon/index.d.ts | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Icon/Icon.test.tsx b/src/Icon/Icon.test.tsx index 5ac95ca04d..43cf4ce091 100644 --- a/src/Icon/Icon.test.tsx +++ b/src/Icon/Icon.test.tsx @@ -102,5 +102,13 @@ describe('', () => { expect(iconSpan.classList.contains('pgn__icon__xs')).toEqual(true); }); + + it('receives style or other arbitrary HTML properties correctly', () => { + const { container } = render(); + const iconSpans = container.querySelectorAll('span'); + const iconSpan = iconSpans[0]; + + expect(iconSpan.style.color).toEqual('red'); + }); }); }); diff --git a/src/Icon/index.d.ts b/src/Icon/index.d.ts index 654cbdd015..45505bb49a 100644 --- a/src/Icon/index.d.ts +++ b/src/Icon/index.d.ts @@ -1,6 +1,6 @@ import React from 'react'; -export interface IconProps { +export interface IconProps extends React.ComponentPropsWithoutRef<'span'> { src?: React.ReactElement | Function; svgAttrs?: { 'aria-label'?: string;