Skip to content
This repository has been archived by the owner on Aug 13, 2023. It is now read-only.

Commit

Permalink
Merge pull request #3279 from bbc/3183-stories-broken-for-variants
Browse files Browse the repository at this point in the history
Fix stories that are broken for variants
  • Loading branch information
Ruth Bochere authored Mar 24, 2020
2 parents 63960c4 + 5d4b9e2 commit ffe2fbd
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/utilities/psammead-storybook-helpers/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<!-- prettier-ignore -->
| Version | Description |
|---------|-------------|
| 8.2.6 | [PR#3279](https://github.com/bbc/psammead/pull/3279) Add `selectedService` to withServicesKnob `storyProps` |
| 8.2.5 | [PR#3135](https://github.com/bbc/psammead/pull/3135) Talos - Bump Dependencies - @bbc/gel-foundations |
| 8.2.4 | [PR#3129](https://github.com/bbc/psammead/pull/3129) Talos - Bump Dependencies - @bbc/gel-foundations |
| 8.2.3 | [PR#2978](https://github.com/bbc/psammead/pull/2978) Talos - Bump Dependencies - @bbc/gel-foundations |
Expand Down
1 change: 1 addition & 0 deletions packages/utilities/psammead-storybook-helpers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ This package provides a collection of common values that are used in storybook b
- `service`: The name of the chosen service e.g. `arabic`.
- `variant`: The variant value of a chosen service, e.g `serbianLat` will have variant `lat`. Non variant service will default to `default`.
- `articlePath`: A path to an article in the relevant service.
- `selectedService`: The name of the selected service as it appears in the dropdown of available services.

2. Toggles the layout directionality of the chosen service.

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/utilities/psammead-storybook-helpers/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bbc/psammead-storybook-helpers",
"version": "8.2.5",
"version": "8.2.6",
"main": "dist/index.js",
"module": "esm/index.js",
"sideEffects": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export default ({
dir,
service,
variant: variant || 'default',
selectedService,
};

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ it('should pass the correct props to the story function', () => {
dir: 'ltr',
locale: 'en',
variant: 'default',
selectedService: 'news',
};

expect(mockStoryFn).toHaveBeenCalledWith(expected);
Expand All @@ -90,6 +91,7 @@ it('should pass the correct chosen service props to the story function', () => {
dir: 'rtl',
locale: 'ar',
variant: 'default',
selectedService: 'arabic',
};

expect(mockStoryFn).toHaveBeenCalledWith(expected);
Expand All @@ -111,6 +113,7 @@ it('should pass the correct chosen service props to the story function', () => {
dir: 'ltr',
locale: 'zh-cn',
variant: 'simp',
selectedService: 'ukchinaSimp',
};

expect(mockStoryFn).toHaveBeenCalledWith(expected);
Expand Down

0 comments on commit ffe2fbd

Please sign in to comment.