diff --git a/react/Highlight/Highlight.demo.js b/react/Highlight/Highlight.demo.js index da81b2f2..2b2c43c8 100644 --- a/react/Highlight/Highlight.demo.js +++ b/react/Highlight/Highlight.demo.js @@ -17,7 +17,7 @@ export default { component: Text, initialProps: { headline: true, - children: renderChildren({ tone: TONE.NEUTRAL }) + children: renderChildren({}) }, options: [ { diff --git a/react/Highlight/Highlight.js b/react/Highlight/Highlight.js index 22c05431..506e6455 100644 --- a/react/Highlight/Highlight.js +++ b/react/Highlight/Highlight.js @@ -8,11 +8,11 @@ type Props = { children: React$Node, secondary?: boolean, className?: string, - tone?: typeof TONE.CRITICAL | typeof TONE.NEUTRAL + tone?: typeof TONE.CRITICAL }; export default function Highlight(props: Props) { - const { children, secondary, tone = TONE.NEUTRAL, className, ...restProps } = props; + const { children, secondary, tone, className, ...restProps } = props; return ( {children} diff --git a/react/Highlight/Highlight.test.js b/react/Highlight/Highlight.test.js new file mode 100644 index 00000000..dc755e98 --- /dev/null +++ b/react/Highlight/Highlight.test.js @@ -0,0 +1,22 @@ +import React from 'react'; +import { shallow } from 'enzyme'; + +import Highlight from './Highlight'; + +describe('Highlight:', () => { + it('should render with defaults', () => { + expect(shallow(text)).toMatchSnapshot(); + }); + + it('should render with className', () => { + expect(shallow(text)).toMatchSnapshot(); + }); + + it('should render with tone', () => { + expect(shallow(text)).toMatchSnapshot(); + }); + + it('should render as secondary', () => { + expect(shallow(text)).toMatchSnapshot(); + }); +}); diff --git a/react/Highlight/__snapshots__/Highlight.test.js.snap b/react/Highlight/__snapshots__/Highlight.test.js.snap new file mode 100644 index 00000000..6c0e4cd6 --- /dev/null +++ b/react/Highlight/__snapshots__/Highlight.test.js.snap @@ -0,0 +1,33 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Highlight: should render as secondary 1`] = ` + + text + +`; + +exports[`Highlight: should render with className 1`] = ` + + text + +`; + +exports[`Highlight: should render with defaults 1`] = ` + + text + +`; + +exports[`Highlight: should render with tone 1`] = ` + + text + +`;