[Sprint/HipsterHedgehog](bug): Forgot password validation and refactor
Closes #1442
I'm open on ideas on how to test this as forgot password locally leads to a blank screen for me. Tried to do this test driven as I cannot see the result.
0/2 discussions resolved
approved this merge request
- Last updated by Marcelo Rivera
96 code: this.code, 97 username: this.username 98 }) 99 .then((response: any) => { 100 this.session.login(response.user); 101 this.router.navigate(['/newsfeed']); 102 }) 103 .catch((e) => { 104 this.error = e.message; 105 setTimeout(() => { 106 this.router.navigate(['/login']); 107 }, 2000); 108 }); 91 this.error = ''; 92 if (!this.validatePassword(password)) { 93 this.error = 'Password must have more than 8 characters. Including uppercase, numbers, special characters (ie. !,#,@), and cannot have spaces.'; - Maintainer
This should be in the template with the translation markers wrapped around it.
- Developer
I agree with Brian. Pretty important not to ignore i18n here.
251 clientMock.post.calls.reset(); 252 sessionMock.login.calls.reset(); 253 getResetButton().nativeElement.click(); 254 255 tick(); 256 fixture.detectChanges(); 257 258 expect(getError().nativeElement.textContent).toContain('Password must have more than 8 characters. Including uppercase, numbers, special characters (ie. !,#,@), and cannot have spaces.'); 259 expect(clientMock.post).not.toHaveBeenCalled(); 260 expect(sessionMock.login).not.toHaveBeenCalled(); 261 })); 262 263 it('should not allow the user to enter a password with fewer than 8 characters', fakeAsync(() => { 264 comp.step = 3; 265 comp.username = 'test'; 266 comp.code = 'code'; - Maintainer
Amazing tests.
closed