Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mollerjorge committed Dec 4, 2024
1 parent 293ef57 commit f6ee802
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/polaris-viz/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ and adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [15.3.4] - 2024-12-03

### Added

- Added dashed `lineStyle` support for custom legends in `<LineChartRelational />`

### Fixed

- Fixed issue where `<DonutChart />` would run the `seriesNameFormatter` for multiple times on a `<Legend />`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,12 @@ describe('<LinePreview />', () => {

expect(linePreview).toContainReactComponentTimes('circle', 3);
});

it('renders a dashed path if lineStyle is dashed', () => {
const linePreview = mount(<LinePreview color="red" lineStyle="dashed" />);

expect(linePreview).toContainReactComponent('path', {
strokeDasharray: '1.5 3',
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,12 @@ describe('isComparison', () => {
lineStyle: 'dotted',
});
});

it('renders LinePreview as dashed when lineStyle prop is set to dashed', () => {
const component = mount(
<SeriesIcon shape="Line" color="red" lineStyle="dashed" />,
);

expect(component.find(LinePreview)).toHaveReactProps({lineStyle: 'dashed'});
});
});

0 comments on commit f6ee802

Please sign in to comment.