This repository has been archived by the owner on Aug 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'latest' into UpdateStories
- Loading branch information
Showing
17 changed files
with
119 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,11 @@ | ||
import React from 'react'; | ||
import { Img } from '.'; | ||
import stories from './testHelpers/stories'; | ||
import stories, { getProps } from './testHelpers/stories'; | ||
import { landscape } from './testHelpers/fixtureData'; | ||
import notes from '../README.md'; | ||
|
||
stories(Img, 'Image - Img'); | ||
stories(Img, 'Image - Img').add( | ||
'image without width', | ||
() => <Img {...getProps(landscape, false)} width={null} />, | ||
{ notes }, | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,23 @@ | ||
import Image, { Img } from '.'; | ||
import React from 'react'; | ||
import { shouldMatchSnapshot } from '@bbc/psammead-test-helpers'; | ||
import snapshotTests from './testHelpers/snapshotTests'; | ||
import { landscape } from './testHelpers/fixtureData'; | ||
import Image, { Img } from '.'; | ||
|
||
describe("Image - imported as '{ Img }'", () => { | ||
describe("Image - imported as default 'Image'", () => { | ||
const props = { ...landscape, width: null }; | ||
shouldMatchSnapshot( | ||
'should render image correctly without width', | ||
<Image {...props} />, | ||
); | ||
snapshotTests(Img); | ||
}); | ||
|
||
describe("Image - imported as default 'Image'", () => { | ||
describe("Image - imported as '{ Img }'", () => { | ||
const props = { ...landscape, width: null }; | ||
shouldMatchSnapshot( | ||
'should render image correctly without width', | ||
<Img {...props} />, | ||
); | ||
snapshotTests(Image); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/utilities/psammead-storybook-helpers/package-lock.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
packages/utilities/psammead-storybook-helpers/src/decorators.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import inputProvider from './input-provider'; | ||
|
||
/* eslint-disable import/prefer-default-export */ | ||
export const dirDecorator = storyFn => { | ||
const decoratedComponent = inputProvider(null, storyFn); | ||
return decoratedComponent(); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
import inputProvider from './input-provider'; | ||
import { dirDecorator } from './decorators'; | ||
import LANGUAGE_VARIANTS from './text-variants'; | ||
|
||
export { inputProvider, LANGUAGE_VARIANTS }; | ||
export { inputProvider, LANGUAGE_VARIANTS, dirDecorator }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters