From e46ec38c630c021e0a933a3914eef51eb5ebe5db Mon Sep 17 00:00:00 2001 From: David Zearing Date: Fri, 19 Jun 2020 10:15:31 -0700 Subject: [PATCH 01/19] Updates. --- .../src/components/Button/Button.stories.tsx | 25 ++++++----- .../src/components/Button/Button.test.tsx | 39 ++++++++++++++++ .../src/components/Button/Button.types.tsx | 17 ++++++- .../src/components/Button/ButtonBase.tsx | 2 + .../components/Button/Converged.stories.tsx | 45 ++++++++++++++++--- .../src/components/Button/useButton.ts | 13 +++++- 6 files changed, 122 insertions(+), 19 deletions(-) create mode 100644 packages/react-button/src/components/Button/Button.test.tsx diff --git a/packages/react-button/src/components/Button/Button.stories.tsx b/packages/react-button/src/components/Button/Button.stories.tsx index 8be213c952be8..49a6cc2e3e1c1 100644 --- a/packages/react-button/src/components/Button/Button.stories.tsx +++ b/packages/react-button/src/components/Button/Button.stories.tsx @@ -6,10 +6,10 @@ import { Stack, Text } from 'office-ui-fabric-react'; const ButtonVariants = (props: ButtonProps) => (
-
); @@ -149,7 +149,6 @@ export const ButtonTokens = () => ( fontFamily: 'Circular, Helvetica, Arial, sans-serif', fontSize: '14px', fontWeight: '700', - background: 'rgb(29, 185, 84) none repeat scroll 0% 0% / auto padding-box border-box', contentColor: 'rgb(255, 255, 255)', borderColor: 'rgb(255, 255, 255)', @@ -187,19 +186,25 @@ export const ButtonTokens = () => ( A tokenized button can be customized for any size or padding.
- -
diff --git a/packages/react-button/src/components/Button/Button.test.tsx b/packages/react-button/src/components/Button/Button.test.tsx new file mode 100644 index 0000000000000..02c70665242ac --- /dev/null +++ b/packages/react-button/src/components/Button/Button.test.tsx @@ -0,0 +1,39 @@ +import * as React from 'react'; +import { Button } from './Button'; +import * as renderer from 'react-test-renderer'; +import { ButtonRef } from './Button.types'; +import { mount, ReactWrapper } from 'enzyme'; + +describe('Button', () => { + let wrapper: ReactWrapper | undefined; + + afterEach(() => { + if (wrapper) { + wrapper.unmount(); + wrapper = undefined; + } + }); + + /** + * Note: see more visual regression tests for Button in /apps/vr-tests + */ + it('renders a default state', () => { + const component = renderer.create( +`; From 2017cf718a24d1b1d451c3fd2462564dee90ce15 Mon Sep 17 00:00:00 2001 From: David Zearing Date: Fri, 19 Jun 2020 13:24:33 -0700 Subject: [PATCH 07/19] better. --- packages/react-button/src/components/Button/Button.test.tsx | 2 +- packages/react-button/src/components/Button/ButtonBase.tsx | 4 +++- .../src/components/Button/__snapshots__/Button.test.tsx.snap | 5 ----- packages/react-compose/src/types.ts | 2 +- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/packages/react-button/src/components/Button/Button.test.tsx b/packages/react-button/src/components/Button/Button.test.tsx index 5ed4ca77bbcf7..93bdf8c3622f0 100644 --- a/packages/react-button/src/components/Button/Button.test.tsx +++ b/packages/react-button/src/components/Button/Button.test.tsx @@ -29,7 +29,7 @@ describe('Button', () => { wrapper = mount(