mise en place des tests et test de workflows
This commit is contained in:
@@ -21,6 +21,7 @@ describe('LoginComponent', () => {
|
||||
mockToastrService = {
|
||||
warning: jest.fn(),
|
||||
success: jest.fn(),
|
||||
info: jest.fn(),
|
||||
error: jest.fn()
|
||||
};
|
||||
|
||||
@@ -41,6 +42,11 @@ describe('LoginComponent', () => {
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
// si le composant instancie subscriptions/timers
|
||||
fixture.destroy();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
@@ -79,9 +85,9 @@ describe('LoginComponent', () => {
|
||||
|
||||
await component.login({email: 'fail@test.com', password: 'fail'});
|
||||
|
||||
expect(mockToastrService.warning).toHaveBeenCalledWith(
|
||||
expect(mockToastrService.info).toHaveBeenCalledWith(
|
||||
'Vous devez vérifier votre adresse e-mail avant de vous connecter.',
|
||||
'Erreur de connexion',
|
||||
'Information de connexion',
|
||||
{
|
||||
closeButton: true,
|
||||
progressAnimation: 'decreasing',
|
||||
|
||||
Reference in New Issue
Block a user