diff --git a/src/__stories__/useFavicon.story.tsx b/src/__stories__/useFavicon.story.tsx index 78817b61..30b4bc5b 100644 --- a/src/__stories__/useFavicon.story.tsx +++ b/src/__stories__/useFavicon.story.tsx @@ -1,16 +1,19 @@ import {storiesOf} from '@storybook/react'; import * as React from 'react'; import {useFavicon} from '..'; +import NewTabStory from './util/NewTabStory'; import ShowDocs from '../util/ShowDocs'; const Demo = () => { useFavicon('https://cdn.sstatic.net/Sites/stackoverflow/img/favicon.ico'); - return null; + return ( + + Favicon should be the Stack Overflow logo + + ); }; storiesOf('Side effects|useFavicon', module) .add('Docs', () => ) - .add('Demo', () => - - ) + .add('Demo', () => ) diff --git a/src/__stories__/useTitle.story.tsx b/src/__stories__/useTitle.story.tsx index 68270026..c12dc276 100644 --- a/src/__stories__/useTitle.story.tsx +++ b/src/__stories__/useTitle.story.tsx @@ -1,16 +1,19 @@ import {storiesOf} from '@storybook/react'; import * as React from 'react'; import {useTitle} from '..'; +import NewTabStory from './util/NewTabStory'; import ShowDocs from '../util/ShowDocs'; const Demo = () => { useTitle('Hello world!'); - return null; + return ( + + Title should be "Hello world!" + + ); }; storiesOf('Side effects|useTitle', module) .add('Docs', () => ) - .add('Demo', () => - - ) + .add('Demo', () => ) diff --git a/src/__stories__/util/NewTabStory.tsx b/src/__stories__/util/NewTabStory.tsx new file mode 100644 index 00000000..76f1500b --- /dev/null +++ b/src/__stories__/util/NewTabStory.tsx @@ -0,0 +1,15 @@ +import * as React from 'react'; + +const NewTabStory = ({children}) => { + if (window.location === window.parent.location) { + return children + } + + return ( +

+ This story should be opened in a new tab. +

+ ); +} + +export default NewTabStory