-
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.
feat: Redesign error popover for sign in page (#3346)
- Loading branch information
1 parent
e8932a9
commit 5e0cc02
Showing
7 changed files
with
59 additions
and
45 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
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,29 +1,39 @@ | ||
$details-color: #ababab; | ||
@import '../../../../theme/colors.scss'; | ||
|
||
.error-internal { | ||
&--header { | ||
&__header { | ||
font-size: 20px; | ||
padding: 16px; | ||
font-weight: 700; | ||
} | ||
|
||
&--details { | ||
font-size: 16px; | ||
padding: 0 16px; | ||
font-weight: 500; | ||
color: $details-color; | ||
} | ||
display: flex; | ||
flex-direction: row; | ||
border-bottom: 1px solid $grey-lighter; | ||
gap: 12px; | ||
|
||
&--primary-cta { | ||
padding: 16px; | ||
.mat-button-base { | ||
&__header-text { | ||
align-items: center; | ||
justify-content: center; | ||
width: 100%; | ||
font-weight: 700; | ||
min-height: 47px; | ||
display: flex; | ||
flex-direction: row; | ||
} | ||
} | ||
|
||
&--redirect { | ||
&__close-icon { | ||
align-self: flex-start; | ||
} | ||
|
||
&__primary-cta { | ||
padding: 0 16px 16px; | ||
} | ||
|
||
&__details { | ||
font-size: 16px; | ||
padding: 20px 16px; | ||
color: $black; | ||
} | ||
|
||
&__redirect { | ||
text-decoration: none; | ||
} | ||
} |
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 |
---|---|---|
|
@@ -35,11 +35,11 @@ describe('ErrorComponent', () => { | |
}); | ||
|
||
it('should have a default header', () => { | ||
expect(component.header).toEqual('Account does not Exist'); | ||
expect(component.header).toEqual('Account does not exist'); | ||
}); | ||
|
||
it('tryAgainClicked(): should dismiss the popover on try again button click', async () => { | ||
const tryAgainBtn = getElementBySelector(fixture, '.error-internal--primary-cta button') as HTMLButtonElement; | ||
it('closePopover(): should dismiss the popover on try again button click', async () => { | ||
const tryAgainBtn = getElementBySelector(fixture, '.error-internal__primary-cta ion-button') as HTMLButtonElement; | ||
click(tryAgainBtn); | ||
fixture.detectChanges(); | ||
await fixture.whenStable(); | ||
|
@@ -59,18 +59,18 @@ describe('ErrorComponent', () => { | |
it('should display the correct error message for status 401 and data is present', () => { | ||
component.error = { status: 401, data: { message: 'Invalid email or password' } }; | ||
fixture.detectChanges(); | ||
const errorMessage = getElementBySelector(fixture, '.error-internal--details'); | ||
const resetLink = getElementBySelector(fixture, '.error-internal--redirect'); | ||
const errorMessage = getElementBySelector(fixture, '.error-internal__details'); | ||
const resetLink = getElementBySelector(fixture, '.error-internal__redirect'); | ||
expect(getTextContent(errorMessage)).toContain( | ||
'This email address will be temporarily locked after 5 unsuccessful login attempts. Try resetting your password?' | ||
'This email address will be temporarily locked after 5 unsuccessful login attempts. Would you like to try resetting your password?' | ||
); | ||
expect(resetLink).toBeTruthy(); | ||
}); | ||
|
||
it('should display the correct error message for status 400', () => { | ||
component.error = { status: 400 }; | ||
fixture.detectChanges(); | ||
const errorMessage = getElementBySelector(fixture, '.error-internal--details'); | ||
const errorMessage = getElementBySelector(fixture, '.error-internal__details'); | ||
expect(getTextContent(errorMessage)).toContain( | ||
'Your account is not verified. Please request a verification link, if required' | ||
); | ||
|
@@ -79,7 +79,7 @@ describe('ErrorComponent', () => { | |
it('should display the correct error message for status 500', () => { | ||
component.error = { status: 500 }; | ||
fixture.detectChanges(); | ||
const errorMessage = getElementBySelector(fixture, '.error-internal--details'); | ||
const errorMessage = getElementBySelector(fixture, '.error-internal__details'); | ||
const supportLink = getElementBySelector(fixture, 'a'); | ||
expect(getTextContent(errorMessage)).toContain( | ||
'Please retry in a while. Send us a note to [email protected] if the problem persists.' | ||
|
@@ -90,7 +90,7 @@ describe('ErrorComponent', () => { | |
it('should display the correct error message for status 433', () => { | ||
component.error = { status: 433 }; | ||
fixture.detectChanges(); | ||
const errorMessage = getElementBySelector(fixture, '.error-internal--details'); | ||
const errorMessage = getElementBySelector(fixture, '.error-internal__details'); | ||
expect(getTextContent(errorMessage)).toContain( | ||
'This email address is locked temporarily, as there are too many unsuccessful login attempts recently. Please retry later.' | ||
); | ||
|
@@ -99,7 +99,7 @@ describe('ErrorComponent', () => { | |
it('should display the correct error message for status 401 and no data or message is present', () => { | ||
component.error = { status: 401 }; | ||
fixture.detectChanges(); | ||
const errorMessage = getElementBySelector(fixture, '.error-internal--details'); | ||
const errorMessage = getElementBySelector(fixture, '.error-internal__details'); | ||
expect(getTextContent(errorMessage)).toContain( | ||
'Your organization has restricted Fyle access to its corporate network.' | ||
); | ||
|
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
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
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
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