Advertisement
Guest User

Untitled

a guest
Jul 12th, 2016
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. import { AuthService } from '../app/services/AuthService';
  2. import { LoginComponent } from '../app/login/LoginComponent';
  3. import { inject, beforeEach } from '@angular/core/testing';
  4.  
  5.  
  6. describe("First Test", function () {
  7. it("Is True", function () {
  8. expect(true).toEqual(true);
  9. })
  10. })
  11.  
  12. describe('auth service', function () {
  13. let auth: AuthService;
  14. let tempUserName = "TestClientPortalAdmin";
  15. let tempPassword = "yZ28MFqe";
  16.  
  17. beforeEach(inject([AuthService], (a) => {
  18. auth = a;
  19. auth.Login(tempUserName, tempPassword);
  20.  
  21. }));
  22.  
  23. it('testing getUserRole to ensure proper string is returned', function () {
  24.  
  25. let log: LoginComponent;
  26.  
  27. log.login(tempUserName, tempPassword);
  28. auth.Login(tempUserName, tempPassword);
  29.  
  30. let temp = this.auth.getUserRole();
  31. expect(this.temp).toBe("Admin");
  32. });
  33. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement