-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Supprime la propriété withPassword uniquement utilisée dans storybook…
… qui apporte de la confusion
- Loading branch information
Showing
6 changed files
with
27 additions
and
46 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
import {useState} from 'react'; | ||
import {Meta, StoryObj} from '@storybook/react'; | ||
import {action} from '@storybook/addon-actions'; | ||
import {Login} from './Login'; | ||
import {LoginView} from './type'; | ||
import { action } from '@storybook/addon-actions'; | ||
import { Meta, StoryObj } from '@storybook/react'; | ||
import { useState } from 'react'; | ||
import { Login } from './Login'; | ||
import { LoginView } from './type'; | ||
|
||
const meta: Meta<typeof Login> = { | ||
component: Login, | ||
|
@@ -14,9 +14,9 @@ const meta: Meta<typeof Login> = { | |
action('getPasswordStrength')(...args); | ||
return null; | ||
}, | ||
defaultValues: {email: '[email protected]', otp: ''}, | ||
defaultValues: { email: '[email protected]', otp: '' }, | ||
}, | ||
render: props => { | ||
render: (props) => { | ||
// eslint-disable-next-line react-hooks/rules-of-hooks | ||
const [view, setView] = useState<LoginView>(props.view || 'etape1'); | ||
const onSetView: typeof setView = (...args) => { | ||
|
@@ -31,38 +31,30 @@ export default meta; | |
|
||
type Story = StoryObj<typeof Login>; | ||
|
||
export const SansMotDePasse: Story = { | ||
export const Default: Story = { | ||
args: {}, | ||
}; | ||
|
||
export const MsgLienEnvoye: Story = { | ||
args: {view: 'msg_lien_envoye'}, | ||
args: { view: 'msg_lien_envoye' }, | ||
}; | ||
|
||
export const AvecErreur: Story = { | ||
args: {error: 'Une erreur est survenue...'}, | ||
}; | ||
|
||
export const AvecMotDePasse: Story = { | ||
args: {withPassword: true}, | ||
}; | ||
|
||
export const AvecMotDePasseEtErreur: Story = { | ||
args: {withPassword: true, error: 'Une erreur est survenue...'}, | ||
args: { error: 'Une erreur est survenue...' }, | ||
}; | ||
|
||
export const MotDePasseOublie: Story = { | ||
args: {view: 'mdp_oublie'}, | ||
args: { view: 'mdp_oublie' }, | ||
}; | ||
|
||
export const MsgInitMdp: Story = { | ||
args: {view: 'msg_init_mdp'}, | ||
args: { view: 'msg_init_mdp' }, | ||
}; | ||
|
||
export const Recover: Story = { | ||
args: {view: 'recover'}, | ||
args: { view: 'recover' }, | ||
}; | ||
|
||
export const ReinitMotDePasse: Story = { | ||
args: {view: 'reset_mdp'}, | ||
args: { view: 'reset_mdp' }, | ||
}; |
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,8 +1,8 @@ | ||
import {useState} from 'react'; | ||
import {Meta, StoryObj} from '@storybook/react'; | ||
import {action} from '@storybook/addon-actions'; | ||
import {Signup} from './Signup'; | ||
import {SignupView} from './type'; | ||
import { action } from '@storybook/addon-actions'; | ||
import { Meta, StoryObj } from '@storybook/react'; | ||
import { useState } from 'react'; | ||
import { Signup } from './Signup'; | ||
import { SignupView } from './type'; | ||
|
||
const meta: Meta<typeof Signup> = { | ||
component: Signup, | ||
|
@@ -11,8 +11,8 @@ const meta: Meta<typeof Signup> = { | |
email: '[email protected]', | ||
}, | ||
collectivites: [ | ||
{value: 1270, label: 'Grenoble'}, | ||
{value: 5460, label: '#Collectivité Test'}, | ||
{ value: 1270, label: 'Grenoble' }, | ||
{ value: 5460, label: '#Collectivité Test' }, | ||
], | ||
onSubmit: action('onSubmit'), | ||
onCancel: action('onCancel'), | ||
|
@@ -22,7 +22,7 @@ const meta: Meta<typeof Signup> = { | |
return null; | ||
}, | ||
}, | ||
render: props => { | ||
render: (props) => { | ||
// eslint-disable-next-line react-hooks/rules-of-hooks | ||
const [view, setView] = useState<SignupView>(props.view || 'etape1'); | ||
const onSetView: typeof setView = (...args) => { | ||
|
@@ -41,27 +41,20 @@ export const Default: Story = { | |
args: {}, | ||
}; | ||
|
||
export const Etape1AvecMdp: Story = { | ||
args: { | ||
view: 'etape1', | ||
withPassword: true, | ||
}, | ||
}; | ||
|
||
export const Etape2: Story = { | ||
args: { | ||
view: 'etape2', | ||
}, | ||
}; | ||
|
||
export const Etape2Erreur: Story = { | ||
args: {view: 'etape2', error: "Message d'erreur"}, | ||
args: { view: 'etape2', error: "Message d'erreur" }, | ||
}; | ||
|
||
export const Etape3: Story = { | ||
args: {view: 'etape3'}, | ||
args: { view: 'etape3' }, | ||
}; | ||
|
||
export const Etape3Erreur: Story = { | ||
args: {view: 'etape3', error: "Message d'erreur"}, | ||
args: { view: 'etape3', error: "Message d'erreur" }, | ||
}; |
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