Skip to content

Commit

Permalink
Final change - 100% frontend & e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
cname87 committed Nov 17, 2019
1 parent bdab25f commit cc274c0
Showing 1 changed file with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ interface ILocationSpy {

interface IAuthServiceSpy {
isLoggedIn: boolean;
isAuthenticated$: {
subscribe: (object: { next: () => any }) => void;
};
}
describe('InformationComponent', () => {
/* setup function run by each sub test suite */
Expand All @@ -34,7 +37,11 @@ describe('InformationComponent', () => {
let authServiceSpy = jasmine.createSpyObj('authService', ['dummy']);
authServiceSpy = {
...authServiceSpy,
isLoggedIn: true,
isAuthenticated$: {
subscribe: (object: any) => {
object.next(true);
},
},
};

/* set up Testbed */
Expand Down Expand Up @@ -76,12 +83,14 @@ describe('InformationComponent', () => {
) {
const backSpy = locationSpy.back.and.stub();

authServiceSpy.isLoggedIn = isAuthenticated;
const isAuthenticatedSpy = authServiceSpy.isLoggedIn;
authServiceSpy.isAuthenticated$ = {
subscribe: (object: any) => {
object.next(isAuthenticated);
},
};

return {
backSpy,
isAuthenticatedSpy,
};
}

Expand Down

0 comments on commit cc274c0

Please sign in to comment.