generated from amosproj/amos202Xss0Y-projname
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #260 from amosproj/refactor/xd-243
Refactor/xd 243
- Loading branch information
Showing
102 changed files
with
1,449 additions
and
1,397 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,7 +50,7 @@ describe('HeaderComponent', () => { | |
} as unknown as LocalStorageService; | ||
|
||
authenticationServiceMock = { | ||
getUserMail: jest.fn().mockReturnValue('[email protected]'), | ||
getUserEmail: jest.fn().mockReturnValue('[email protected]'), | ||
logout: jest.fn() | ||
} as unknown as AuthenticationService; | ||
|
||
|
@@ -76,21 +76,21 @@ describe('HeaderComponent', () => { | |
it('should trigger router events correctly', () => { | ||
eventsSubject.next(new NavigationEnd(1, '', '')); | ||
|
||
const routerEvents = component.routerEvents(); | ||
const routerEvents = component['routerEvents'](); | ||
expect(routerEvents).toBeInstanceOf(NavigationEnd); | ||
}); | ||
|
||
it('should compute breadcrumbs correctly', () => { | ||
eventsSubject.next(new NavigationEnd(1, '', '')); | ||
|
||
const breadcrumbs = component.breadcrumbs(); | ||
const breadcrumbs = component['breadcrumbs'](); | ||
expect(breadcrumbs).toEqual([ 'Layer 1', 'Layer 2' ]); | ||
}); | ||
|
||
it('should determine if it is home page correctly', () => { | ||
eventsSubject.next(new NavigationEnd(1, '', '')); | ||
|
||
const isHomePage = component.isHomePage(); | ||
const isHomePage = component['isHomePage'](); | ||
expect(isHomePage).toBe(true); | ||
}); | ||
|
||
|
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
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
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
Binary file not shown.
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.tile-color { | ||
background-color: var(--theme-color-1--hover); | ||
} |
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,7 +1,6 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
import { Router } from '@angular/router'; | ||
import { AuthenticationService } from 'common-frontend-models'; | ||
import { of } from 'rxjs'; | ||
|
||
import { LoginPage } from './login.page'; | ||
|
||
|
@@ -13,7 +12,8 @@ describe('LoginPage', () => { | |
|
||
beforeEach(async () => { | ||
authServiceMock = { | ||
login: jest.fn().mockReturnValue(of(true)), | ||
login: jest.fn().mockReturnValue(true), | ||
isLoggedIn: jest.fn().mockReturnValue(false), | ||
} as unknown as jest.Mocked<AuthenticationService>; | ||
|
||
routerMock = { | ||
|
@@ -39,16 +39,17 @@ describe('LoginPage', () => { | |
|
||
describe('onSubmit', () => { | ||
it('should not validate form if email or password is invalid', () => { | ||
component.email = 'invalid-email'; | ||
component.password = ''; | ||
// bypass protected attribute using bracket notation | ||
component['email'] = 'invalid-email'; | ||
component['password'] = ''; | ||
component.onSubmit(); | ||
|
||
expect(routerMock.navigate).not.toHaveBeenCalled(); | ||
}); | ||
|
||
it('should validate form and login successfully', () => { | ||
component.email = '[email protected]'; | ||
component.password = 'password'; | ||
component['email']= '[email protected]'; | ||
component['password'] = 'password'; | ||
component.onSubmit(); | ||
|
||
expect(routerMock.navigate).toHaveBeenCalledWith([ '/' ]); | ||
|
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
Oops, something went wrong.