changement
This commit is contained in:
@@ -19,8 +19,8 @@ describe('Connexion', () => {
|
||||
renderWithProviders(<Connexion />, { route: '/connexion' })
|
||||
|
||||
expect(screen.getByRole('heading', { name: /se connecter/i })).toBeInTheDocument()
|
||||
expect(screen.getByPlaceholderText(/votre email/i)).toBeInTheDocument()
|
||||
expect(screen.getByPlaceholderText(/votre mot de passe/i)).toBeInTheDocument()
|
||||
expect(screen.getByLabelText(/adresse email/i)).toBeInTheDocument()
|
||||
expect(screen.getByLabelText(/^mot de passe/i)).toBeInTheDocument()
|
||||
expect(screen.getByRole('button', { name: /se connecter/i })).toBeInTheDocument()
|
||||
})
|
||||
|
||||
@@ -37,8 +37,8 @@ describe('Connexion', () => {
|
||||
|
||||
renderWithProviders(<Connexion />, { route: '/connexion' })
|
||||
|
||||
await userEvent.type(screen.getByPlaceholderText(/votre email/i), 'test@example.com')
|
||||
await userEvent.type(screen.getByPlaceholderText(/votre mot de passe/i), 'mauvais-mdp')
|
||||
await userEvent.type(screen.getByLabelText(/adresse email/i), 'test@example.com')
|
||||
await userEvent.type(screen.getByLabelText(/^mot de passe/i), 'mauvais-mdp')
|
||||
await userEvent.click(screen.getByRole('button', { name: /se connecter/i }))
|
||||
|
||||
expect(await screen.findByText('Email ou mot de passe incorrect.')).toBeInTheDocument()
|
||||
@@ -56,8 +56,8 @@ describe('Connexion', () => {
|
||||
routes: { '/mes-gains': <p>Page Mes Gains</p> },
|
||||
})
|
||||
|
||||
await userEvent.type(screen.getByPlaceholderText(/votre email/i), 'client@example.com')
|
||||
await userEvent.type(screen.getByPlaceholderText(/votre mot de passe/i), 'MotDePasse123!')
|
||||
await userEvent.type(screen.getByLabelText(/adresse email/i), 'client@example.com')
|
||||
await userEvent.type(screen.getByLabelText(/^mot de passe/i), 'MotDePasse123!')
|
||||
await userEvent.click(screen.getByRole('button', { name: /se connecter/i }))
|
||||
|
||||
expect(await screen.findByText('Page Mes Gains')).toBeInTheDocument()
|
||||
@@ -75,8 +75,8 @@ describe('Connexion', () => {
|
||||
routes: { '/admin': <p>Page Admin</p> },
|
||||
})
|
||||
|
||||
await userEvent.type(screen.getByPlaceholderText(/votre email/i), 'admin@example.com')
|
||||
await userEvent.type(screen.getByPlaceholderText(/votre mot de passe/i), 'MotDePasse123!')
|
||||
await userEvent.type(screen.getByLabelText(/adresse email/i), 'admin@example.com')
|
||||
await userEvent.type(screen.getByLabelText(/^mot de passe/i), 'MotDePasse123!')
|
||||
await userEvent.click(screen.getByRole('button', { name: /se connecter/i }))
|
||||
|
||||
expect(await screen.findByText('Page Admin')).toBeInTheDocument()
|
||||
|
||||
Reference in New Issue
Block a user