Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(status-indicator): Add snapshots #692

Merged
merged 2 commits into from
Jun 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion modules/status-indicator/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"@workday/design-assets-types": "^0.2.4"
},
"devDependencies": {
"@workday/canvas-system-icons-web": "^1.0.20"
"@workday/canvas-system-icons-web": "^1.0.20",
"@workday/canvas-kit-labs-react-core": "^3.8.0"
}
}
44 changes: 44 additions & 0 deletions modules/status-indicator/react/stories/stories_VisualTesting.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/// <reference path="../../../../typings.d.ts" />
import * as React from 'react';
import {StaticStates} from '@workday/canvas-kit-labs-react-core';
import {
ComponentStatesTable,
permutateProps,
withSnapshotsEnabled,
} from '../../../../utils/storybook';

import {StatusIndicator} from '../';
import {uploadCloudIcon} from '@workday/canvas-system-icons-web';

export default withSnapshotsEnabled({
title: 'Testing|React/Indicators/Status Indicator',
component: StatusIndicator,
});

export const StatusIndicatorStates = () => (
<StaticStates>
<ComponentStatesTable
rowProps={permutateProps({
emphasis: [
{value: StatusIndicator.Emphasis.Low, label: 'Low Emphasis'},
{value: StatusIndicator.Emphasis.High, label: 'High Emphasis'},
],
icon: [{value: undefined, label: ''}, {value: uploadCloudIcon, label: 'With Icon'}],
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Icons don't seem to be rendering in chromatic

})}
columnProps={permutateProps({
type: [
{value: StatusIndicator.Type.Gray, label: 'Gray'},
{value: StatusIndicator.Type.Blue, label: 'Blue'},
{value: StatusIndicator.Type.Green, label: 'Green'},
{value: StatusIndicator.Type.Orange, label: 'Orange'},
{value: StatusIndicator.Type.Red, label: 'Red'},
{value: StatusIndicator.Type.Transparent, label: 'Transparent'},
],
})}
>
{({type, emphasis, props}) => (
<StatusIndicator type={type} emphasis={emphasis} {...props} label="Status" />
)}
</ComponentStatesTable>
</StaticStates>
);