Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { AuthService } from '../app/services/AuthService';
- import { LoginComponent } from '../app/login/LoginComponent';
- import { inject, beforeEach } from '@angular/core/testing';
- describe("First Test", function () {
- it("Is True", function () {
- expect(true).toEqual(true);
- })
- })
- describe('auth service', function () {
- let auth: AuthService;
- let tempUserName = "TestClientPortalAdmin";
- let tempPassword = "yZ28MFqe";
- beforeEach(inject([AuthService], (a) => {
- auth = a;
- auth.Login(tempUserName, tempPassword);
- }));
- it('testing getUserRole to ensure proper string is returned', function () {
- let log: LoginComponent;
- log.login(tempUserName, tempPassword);
- auth.Login(tempUserName, tempPassword);
- let temp = this.auth.getUserRole();
- expect(this.temp).toBe("Admin");
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement