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

Fix stories that are broken for variants #3279

Merged
merged 6 commits into from
Mar 24, 2020
Merged
Show file tree
Hide file tree
Changes from 5 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
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