47 lines
No EOL
1.3 KiB
TypeScript
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", () => {
|
|
|
|
});
|
|
}); |