Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

Commit

Permalink
Test UserAvatar menu including URL image (#17888)
Browse files Browse the repository at this point in the history
  • Loading branch information
Felipe Janer authored Feb 1, 2021
1 parent 7fae022 commit 84eda41
Showing 1 changed file with 54 additions and 1 deletion.
55 changes: 54 additions & 1 deletion client/web/src/nav/UserNavItem.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { WebStory } from '../components/WebStory'

const onThemePreferenceChange = action('onThemePreferenceChange')

const { add } = storiesOf('web/UserNavItem', module)
const { add } = storiesOf('web/nav/UserNavItem', module)

add(
'Site admin',
Expand Down Expand Up @@ -63,3 +63,56 @@ add(
},
}
)
add(
'With Avatar',
() => (
<WebStory>
{webProps => (
<UserNavItem
{...webProps}
testIsOpen={true}
authenticatedUser={{
username: 'alice',
avatarURL: 'https://i.pravatar.cc/300',
session: { canSignOut: true },
settingsURL: '#',
siteAdmin: true,
organizations: {
nodes: [
{
id: '0',
name: 'acme',
displayName: 'Acme Corp',
url: '/organizations/acme',
settingsURL: '/organizations/acme/settings',
},
{
id: '1',
name: 'beta',
displayName: 'Beta Inc',
url: '/organizations/beta',
settingsURL: '/organizations/beta/settings',
},
],
},
}}
themePreference={webProps.isLightTheme ? ThemePreference.Light : ThemePreference.Dark}
onThemePreferenceChange={onThemePreferenceChange}
showDotComMarketing={boolean('showDotComMarketing', true)}
isExtensionAlertAnimating={false}
codeHostIntegrationMessaging={select(
'codeHostIntegrationMessaging',
['browser-extension', 'native-integration'] as const,
'browser-extension'
)}
/>
)}
</WebStory>
),
{
design: {
type: 'figma',
url: 'https://www.figma.com/file/HWLuLefEdev5KYtoEGHjFj/Sourcegraph-Components-Contractor?node-id=1346%3A0',
},
}
)

0 comments on commit 84eda41

Please sign in to comment.