Added @Input to the log-in component that indicates whether the component is being used in the standalone login page or the drop-down.

This commit is contained in:
Michael W Spalti
2019-09-04 14:02:07 -07:00
parent 54fc57d1f3
commit f0813fcbc1
4 changed files with 19 additions and 19 deletions

View File

@@ -58,8 +58,7 @@ describe('LogInComponent', () => {
{provide: AuthService, useClass: AuthServiceStub},
{provide: APP_BASE_HREF, useValue: '/'},
{provide: Router, useClass: RouterStub},
{provide: RouteService, useValue: routeServiceStub },
{provide: HostWindowService, useValue: new HostWindowServiceStub(900) }
{provide: RouteService, useValue: routeServiceStub }
],
schemas: [
CUSTOM_ELEMENTS_SCHEMA
@@ -151,6 +150,8 @@ describe('LogInComponent', () => {
const authService: AuthService = TestBed.get(AuthService);
spyOn(authService, 'setRedirectUrl');
component.isStandalonePage = false;
fixture.detectChanges();
expect(authService.setRedirectUrl).not.toHaveBeenCalledWith();
@@ -193,8 +194,7 @@ describe('LogInComponent on small screen', () => {
{provide: AuthService, useClass: AuthServiceStub},
{provide: APP_BASE_HREF, useValue: '/'},
{provide: Router, useClass: RouterStub},
{provide: RouteService, useValue: routeServiceStub },
{provide: HostWindowService, useValue: new HostWindowServiceStub(300) }
{provide: RouteService, useValue: routeServiceStub }
],
schemas: [
CUSTOM_ELEMENTS_SCHEMA
@@ -230,6 +230,7 @@ describe('LogInComponent on small screen', () => {
it('should set the redirect url on init', () => {
const authService: AuthService = TestBed.get(AuthService);
spyOn(authService, 'setRedirectUrl');
component.isStandalonePage = true;
fixture.detectChanges();
// set FormControl values
component.form.controls.email.setValue('user');