-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
18b7408
commit 01cbfc2
Showing
5 changed files
with
129 additions
and
44 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,21 @@ | ||
<ion-content> | ||
<div class="verify"> | ||
<div class="verify__verifying-loader"> | ||
<ion-icon src="../../../assets/svg/loader.svg" class="verify__verifying-loader__icon"></ion-icon> | ||
<ion-grid class="verify--header-container"> | ||
<ion-row class="verify--header ion-align-items-center"> | ||
<ion-col class="verify--header-logo-container"> | ||
<img class="verify--header-logo" src="../../../assets/svg/fyle-logo-light.svg" alt="fyle-logo-light" /> | ||
</ion-col> | ||
</ion-row> | ||
</ion-grid> | ||
<div class="verify--form"> | ||
<div id="verify--header" class="verify--form-header"> | ||
<span *ngIf="currentPageState === PageStates.verifying"> Verifying Identity </span> | ||
<span *ngIf="currentPageState === PageStates.error"> Verification Failed </span> | ||
</div> | ||
<div *ngIf="currentPageState === PageStates.verifying" class="verify--form-subheader"> | ||
Checking your credentials.. | ||
</div> | ||
<div *ngIf="currentPageState === PageStates.error" class="verify--form-subheader"> | ||
Unable to verify your Fyle account. Please contact support by sending an email to [email protected] | ||
</div> | ||
<div class="verify__verifying-loader__text">Accepting the invite...</div> | ||
</div> | ||
</ion-content> |
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,37 +1,83 @@ | ||
@import '../../../theme/colors'; | ||
|
||
@mixin loader { | ||
border-radius: 50%; | ||
width: 14px; | ||
height: 14px; | ||
margin: 0 4px; | ||
animation: spin 2s linear infinite; | ||
} | ||
$verify-header: #220033; | ||
$form-header: #000; | ||
$form-subheader: #4a4a4a; | ||
$password-icon: #b9beba; | ||
$secondary-cta-border: #e0e0e0; | ||
|
||
@keyframes spin { | ||
0% { | ||
transform: rotate(0deg); | ||
.verify { | ||
&--header { | ||
min-height: 180px; | ||
} | ||
100% { | ||
transform: rotate(360deg); | ||
|
||
&--header-container { | ||
min-height: 180px; | ||
background-color: $verify-header; | ||
} | ||
} | ||
|
||
.verify { | ||
height: 100%; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: center; | ||
|
||
&__verifying-loader { | ||
@include loader; | ||
&__icon { | ||
fill: $brand-primary; | ||
&--header-logo-container { | ||
text-align: center; | ||
} | ||
|
||
&--header-logo { | ||
max-width: 100px; | ||
} | ||
|
||
&--form { | ||
padding: 24px; | ||
} | ||
|
||
&--form-field { | ||
width: 100%; | ||
} | ||
|
||
&--form-header { | ||
font-size: 24px; | ||
margin-top: 16px; | ||
margin-bottom: 8px; | ||
color: $form-header; | ||
font-weight: 700; | ||
} | ||
|
||
&--form-subheader { | ||
font-size: 16px; | ||
color: $form-subheader; | ||
margin-top: 24px; | ||
margin-bottom: 24px; | ||
} | ||
|
||
&--primary-cta { | ||
.mat-button-base { | ||
width: 100%; | ||
font-weight: 700; | ||
min-height: 47px; | ||
} | ||
&__text { | ||
margin-top: 8px; | ||
color: $black; | ||
} | ||
|
||
&--password-visibility-icon { | ||
color: $password-icon; | ||
} | ||
|
||
&--secondary-cta { | ||
.mat-button-base { | ||
width: 100%; | ||
font-weight: 700; | ||
min-height: 47px; | ||
letter-spacing: 1.6px; | ||
border: 1px solid $secondary-cta-border; | ||
} | ||
margin-top: 24px; | ||
} | ||
|
||
&--redirect { | ||
margin: 16px; | ||
text-align: center; | ||
font-size: 16px; | ||
a { | ||
text-decoration: none; | ||
} | ||
} | ||
|
||
&--edit-email { | ||
text-align: end; | ||
} | ||
} |
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 |
---|---|---|
|
@@ -78,6 +78,25 @@ describe('VerifyPage', () => { | |
expect(trackingService.emailVerified).toHaveBeenCalledTimes(1); | ||
expect(trackingService.onSignin).toHaveBeenCalledOnceWith('[email protected]'); | ||
expect(router.navigate).toHaveBeenCalledOnceWith(['/', 'auth', 'switch_org', { invite_link: true }]); | ||
const verifyHeader = getElementBySelector(fixture, '#verify--header'); | ||
const verifySubheader = getElementBySelector(fixture, '.verify--form-subheader'); | ||
expect(getTextContent(verifyHeader)).toContain('Verifying Identity'); | ||
expect(getTextContent(verifySubheader)).toContain('Checking your credentials..'); | ||
}); | ||
|
||
it('should handle error when verification fails', () => { | ||
const mockError = new Error('Verification failed'); | ||
routerAuthService.emailVerify.and.returnValue(throwError(() => mockError)); | ||
fixture.detectChanges(); | ||
spyOn(component, 'handleError'); | ||
component.ngOnInit(); | ||
expect(component.handleError).toHaveBeenCalledOnceWith(mockError); | ||
const verifyHeader = getElementBySelector(fixture, '#verify--header'); | ||
const verifySubheader = getElementBySelector(fixture, '.verify--form-subheader'); | ||
expect(getTextContent(verifyHeader)).toContain('Verification Failed'); | ||
expect(getTextContent(verifySubheader)).toContain( | ||
'Unable to verify your Fyle account. Please contact support by sending an email to [email protected]' | ||
); | ||
}); | ||
}); | ||
|
||
|
@@ -88,6 +107,7 @@ describe('VerifyPage', () => { | |
}; | ||
component.handleError(error); | ||
expect(router.navigate).toHaveBeenCalledOnceWith(['/', 'auth', 'disabled']); | ||
expect(component.currentPageState).not.toEqual(VerifyPageState.error); | ||
}); | ||
|
||
it('should navigate to auth/pending_verification if status code is 440', () => { | ||
|
@@ -101,19 +121,15 @@ describe('VerifyPage', () => { | |
'pending_verification', | ||
{ hasTokenExpired: true, orgId: 'orNVthTo2Zyo' }, | ||
]); | ||
expect(component.currentPageState).not.toEqual(VerifyPageState.error); | ||
}); | ||
|
||
it('should change the page status if error code is something else', () => { | ||
const error = { | ||
status: 404, | ||
}; | ||
component.handleError(error); | ||
expect(router.navigate).toHaveBeenCalledOnceWith([ | ||
'/', | ||
'auth', | ||
'pending_verification', | ||
{ orgId: 'orNVthTo2Zyo' }, | ||
]); | ||
expect(component.currentPageState).toEqual(VerifyPageState.error); | ||
}); | ||
}); | ||
}); |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.