Skip to content
Snippets Groups Projects

[Sprint/HipsterHedgehog](bug): Forgot password validation and refactor

2 unresolved threads

Closes #1442 (moved)

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.

Merge request reports

Pipeline #67424718 passed

Requires 1 approval from Deployers. Approved by

Closed by BenBen 5 years ago (Jun 28, 2019 1:24pm UTC)

Merge details

  • The changes were not merged into master.

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
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.';
  • 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';
  • closed

  • Please register or sign in to reply
    Loading