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
2017-02-28 16:51:43 -05:00

47 lines
No EOL
1.3 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;
beforeEach(() => {
apiServiceMock = jasmine.createSpyObj('apiServiceMock', ['listTriggerBuildSourceNamespaces']);
tableServiceMock = jasmine.createSpyObj('tableServiceMock', ['buildOrderedItems']);
triggerServiceMock = jasmine.createSpyObj('triggerServiceMock', ['getIcon']);
rolesServiceMock = jasmine.createSpyObj('rolesServiceMock', ['setRepositoryRole']);
component = new ManageTriggerGithostComponent(apiServiceMock, tableServiceMock, triggerServiceMock, rolesServiceMock);
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", () => {
});
});