2020-01-08 18:27:54 +00:00
|
|
|
import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing';
|
|
|
|
import { TestBed, ComponentFixture, async } from '@angular/core/testing';
|
|
|
|
import { HttpClient, HttpErrorResponse } from '@angular/common/http';
|
2017-08-25 10:55:53 +00:00
|
|
|
import { LoginPageObject } from './login.po';
|
2020-01-08 18:27:54 +00:00
|
|
|
import { ApiService } from '../src/app/providers/api-service';
|
2017-08-25 10:55:53 +00:00
|
|
|
|
|
|
|
describe('Login Page', () => {
|
|
|
|
let page: LoginPageObject;
|
2020-01-08 18:27:54 +00:00
|
|
|
let api: ApiService;
|
|
|
|
let apiSpy: jasmine.SpyObj<ApiService>;
|
2017-08-25 10:55:53 +00:00
|
|
|
|
|
|
|
beforeEach(() => {
|
|
|
|
page = new LoginPageObject();
|
2020-01-08 18:27:54 +00:00
|
|
|
const spy = jasmine.createSpyObj
|
|
|
|
TestBed.configureTestingModule({ providers: [ApiService] });
|
2017-08-25 10:55:53 +00:00
|
|
|
});
|
|
|
|
|
2020-01-08 18:27:54 +00:00
|
|
|
api = TestBed.get(ApiService);
|
|
|
|
apiSpy = TestBed.get(ApiService);
|
|
|
|
|
2017-08-25 10:55:53 +00:00
|
|
|
it('should have a header saying login', () => {
|
|
|
|
expect(page.getLoginHeaderText()).toEqual('Login');
|
|
|
|
});
|
2017-08-25 11:17:15 +00:00
|
|
|
|
2017-11-13 15:49:17 +00:00
|
|
|
it('should have a username box of type email', () => {
|
2017-08-25 11:17:15 +00:00
|
|
|
expect(page.isUsernameFieldPresent()).toBeTruthy();
|
2017-11-13 15:49:17 +00:00
|
|
|
expect(page.getUsernameFieldType()).toEqual('email');
|
2017-08-25 11:17:15 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should have a password box of type password', () => {
|
|
|
|
expect(page.isPasswordFieldPresent()).toBeTruthy();
|
|
|
|
expect(page.getPasswordFieldType()).toBe('password');
|
|
|
|
});
|
2017-08-25 10:55:53 +00:00
|
|
|
});
|