From 38bd1f376e5b4e5157c7e824a90aa1da8826f7bb Mon Sep 17 00:00:00 2001 From: Mateo Wartelle Date: Tue, 3 Oct 2023 18:31:30 -0500 Subject: [PATCH] fix: button with a label --- src/components/Button/Button.spec.tsx | 9 +++++++++ src/components/Button/Button.stories.tsx | 7 +++++++ src/components/Button/Button.tsx | 7 ++++--- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/components/Button/Button.spec.tsx b/src/components/Button/Button.spec.tsx index 7b533311c9..36bc4f450b 100644 --- a/src/components/Button/Button.spec.tsx +++ b/src/components/Button/Button.spec.tsx @@ -118,6 +118,13 @@ describe('Components / Button', () => { expect(button()).toHaveTextContent('Something or other'); }); + it('should render both children then label', () => { + render(); + + expect(button()).toHaveTextContent('Messages'); + expect(label()).toHaveTextContent('2'); + }); + describe('`as` and `href` props', () => { it('should render an anchor `` when `href=".."`', () => { render(