2017-02-18 09:45:00 +00:00
|
|
|
import { ManageTriggerGithostComponent, Local, Trigger } from './manage-trigger-githost.component';
|
|
|
|
|
|
|
|
|
|
|
|
describe("ManageTriggerGithostComponent", () => {
|
|
|
|
var component: ManageTriggerGithostComponent;
|
|
|
|
var apiServiceMock: any;
|
|
|
|
var tableServiceMock: any;
|
|
|
|
var triggerServiceMock: any;
|
|
|
|
var rolesServiceMock: any;
|
|
|
|
var repository: any;
|
|
|
|
var trigger: Trigger;
|
2017-02-20 02:17:12 +00:00
|
|
|
var $scope: ng.IScope;
|
2017-02-18 09:45:00 +00:00
|
|
|
|
2017-02-20 02:17:12 +00:00
|
|
|
beforeEach(inject(($injector: ng.auto.IInjectorService) => {
|
2017-02-18 09:45:00 +00:00
|
|
|
apiServiceMock = jasmine.createSpyObj('apiServiceMock', ['listTriggerBuildSourceNamespaces']);
|
|
|
|
tableServiceMock = jasmine.createSpyObj('tableServiceMock', ['buildOrderedItems']);
|
|
|
|
triggerServiceMock = jasmine.createSpyObj('triggerServiceMock', ['getIcon']);
|
|
|
|
rolesServiceMock = jasmine.createSpyObj('rolesServiceMock', ['setRepositoryRole']);
|
2017-02-20 02:17:12 +00:00
|
|
|
$scope = $injector.get('$rootScope');
|
|
|
|
component = new ManageTriggerGithostComponent(apiServiceMock,
|
|
|
|
tableServiceMock,
|
|
|
|
triggerServiceMock,
|
|
|
|
rolesServiceMock,
|
|
|
|
$scope);
|
2017-02-18 09:45:00 +00:00
|
|
|
trigger = {service: "serviceMock", id: 1};
|
|
|
|
component.trigger = trigger;
|
2017-02-20 02:17:12 +00:00
|
|
|
}));
|
2017-02-18 09:45:00 +00:00
|
|
|
|
|
|
|
describe("constructor", () => {
|
2017-02-23 01:22:34 +00:00
|
|
|
// TODO
|
2017-02-18 09:45:00 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
describe("$onInit", () => {
|
2017-02-23 01:22:34 +00:00
|
|
|
// TODO
|
2017-02-18 09:45:00 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
describe("getTriggerIcon", () => {
|
|
|
|
|
|
|
|
it("calls trigger service to get icon", () => {
|
|
|
|
component.getTriggerIcon();
|
|
|
|
|
|
|
|
expect(triggerServiceMock.getIcon.calls.argsFor(0)[0]).toEqual(component.trigger.service);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
describe("createTrigger", () => {
|
2017-02-23 01:22:34 +00:00
|
|
|
// TODO
|
2017-02-18 09:45:00 +00:00
|
|
|
});
|
|
|
|
});
|