Skip to content
This repository has been archived by the owner on May 7, 2021. It is now read-only.

Commit

Permalink
fix(tests): Fixed unit tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelkleinhenz committed Mar 6, 2017
1 parent 6595984 commit d7207d1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ <h2 *ngIf="loggedIn" id="wi-detail-title-click" class="detail-title truncate">{{
<span *ngIf="loggedIn" class="caret pull-right"></span>
</button>
<ul *ngIf="loggedIn" id="wi-status-dropdown" class="dropdown-menu-right dropdown-ul" role="menu" dropdownMenu>
<li class="dropdown-li" *ngFor="let state of workItem.relationalData.wiType.attributes.fields['system.state'].type.values;" (click)="onChangeState(state)">
<li class="dropdown-li" *ngFor="let state of workItem.relationalData.wiType?.attributes.fields['system.state'].type.values;" (click)="onChangeState(state)">
<a>
<span class='dropdown-icon' almIcon [iconType]="state"></span>
<span class='dropdown-text'>{{state}}</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { DebugElement } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { By } from '@angular/platform-browser';

import { Logger, Broadcaster } from 'ngx-login-client';
import { Logger, Broadcaster, AuthenticationService } from 'ngx-login-client';

import { WorkItem } from '../../models/work-item';
import { WorkItemService } from '../work-item.service';
Expand All @@ -25,6 +25,7 @@ describe('Quick add work item component - ', () => {
let el: DebugElement;
let fakeWorkItem: WorkItem[];
let fakeService: any;
let fakeAuthService: any;

let wiTypes = [
{
Expand Down Expand Up @@ -140,6 +141,13 @@ describe('Quick add work item component - ', () => {
},
workItemTypes: wiTypes
};

fakeAuthService = {
isLoggedIn: function () {
return true;
},
workItemTypes: wiTypes
};
});

beforeEach(async(() => {
Expand All @@ -154,6 +162,10 @@ describe('Quick add work item component - ', () => {
{
provide: WorkItemService,
useValue: fakeService
},
{
provide: AuthenticationService,
useValue: fakeAuthService
}
]
})
Expand Down

0 comments on commit d7207d1

Please sign in to comment.