This repository has been archived on 2020-03-24. You can view files and clone it, but cannot push or open issues or pull requests.
quay/static/js/directives/ui/manage-trigger-githost/manage-trigger-githost.component.spec.ts

53 lines
1.6 KiB
TypeScript
Raw Normal View History

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", () => {
});
describe("$onInit", () => {
});
describe("$onChanges", () => {
});
describe("getTriggerIcon", () => {
it("calls trigger service to get icon", () => {
component.getTriggerIcon();
expect(triggerServiceMock.getIcon.calls.argsFor(0)[0]).toEqual(component.trigger.service);
});
});
describe("createTrigger", () => {
});
});