49 lines
No EOL
1.6 KiB
TypeScript
49 lines
No EOL
1.6 KiB
TypeScript
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;
|
|
var $scope: ng.IScope;
|
|
|
|
beforeEach(inject(($injector: ng.auto.IInjectorService) => {
|
|
apiServiceMock = jasmine.createSpyObj('apiServiceMock', ['listTriggerBuildSourceNamespaces']);
|
|
tableServiceMock = jasmine.createSpyObj('tableServiceMock', ['buildOrderedItems']);
|
|
triggerServiceMock = jasmine.createSpyObj('triggerServiceMock', ['getIcon']);
|
|
rolesServiceMock = jasmine.createSpyObj('rolesServiceMock', ['setRepositoryRole']);
|
|
$scope = $injector.get('$rootScope');
|
|
component = new ManageTriggerGithostComponent(apiServiceMock,
|
|
tableServiceMock,
|
|
triggerServiceMock,
|
|
rolesServiceMock,
|
|
$scope);
|
|
trigger = {service: "serviceMock", id: 1};
|
|
component.trigger = trigger;
|
|
}));
|
|
|
|
describe("constructor", () => {
|
|
// TODO
|
|
});
|
|
|
|
describe("$onInit", () => {
|
|
// TODO
|
|
});
|
|
|
|
describe("getTriggerIcon", () => {
|
|
|
|
it("calls trigger service to get icon", () => {
|
|
component.getTriggerIcon();
|
|
|
|
expect(triggerServiceMock.getIcon.calls.argsFor(0)[0]).toEqual(component.trigger.service);
|
|
});
|
|
});
|
|
|
|
describe("createTrigger", () => {
|
|
// TODO
|
|
});
|
|
}); |