From c302e3e138d0f53e40acac613f66c1b941e0bff7 Mon Sep 17 00:00:00 2001 From: Seung Park Date: Thu, 15 Sep 2022 10:46:25 -0400 Subject: [PATCH] DOP-3222 follow up: Add unit tests for button uri (#688) * DOP-2579: update banner component (#682) * update banner component to v4. match typography with figma design * minor. fix comment * DOP-2581 (#683) * update lg/badge to v5 * commit package lock file * DOP-2581: update tests (#685) update tests for operations * fix button href * remove redundant else * update snapshot * update color logic on button. add test for button to use link * update snapsho * minor. remove important styling * remove debug console --- src/components/Button.js | 18 ++++++++--------- tests/unit/Button.test.js | 21 +++++++++++++++++--- tests/unit/__snapshots__/Button.test.js.snap | 7 +++++-- 3 files changed, 31 insertions(+), 15 deletions(-) diff --git a/src/components/Button.js b/src/components/Button.js index 18fef644e..1c659612f 100644 --- a/src/components/Button.js +++ b/src/components/Button.js @@ -5,6 +5,13 @@ import ComponentFactory from './ComponentFactory'; import Link from './Link'; import { css, cx } from '@leafygreen-ui/emotion'; +// TODO: include mapping of colors to use against button 'variant' attributes +const buttonStyling = css` + &.button { + color: #ffffff; + } +`; + const Button = ({ nodeData: { argument, @@ -19,16 +26,7 @@ const Button = ({ } return ( - + {argument.map((child, i) => ( ))} diff --git a/tests/unit/Button.test.js b/tests/unit/Button.test.js index f69a8f41f..06a915ba7 100644 --- a/tests/unit/Button.test.js +++ b/tests/unit/Button.test.js @@ -4,8 +4,23 @@ import Button from '../../src/components/Button'; // data for this component import mockData from './data/Button.test.json'; +import Link from '../../src/components/Link'; -it('renders correctly', () => { - const tree = render(