diff --git a/src/app/workflow-spec-list/workflow-spec-list.component.spec.ts b/src/app/workflow-spec-list/workflow-spec-list.component.spec.ts index e304d4a..b6b85fd 100644 --- a/src/app/workflow-spec-list/workflow-spec-list.component.spec.ts +++ b/src/app/workflow-spec-list/workflow-spec-list.component.spec.ts @@ -37,6 +37,7 @@ import { import {GetIconCodePipe} from '../_pipes/get-icon-code.pipe'; import {FileListComponent} from '../file-list/file-list.component'; import {WorkflowSpecCategoryGroup, WorkflowSpecListComponent} from './workflow-spec-list.component'; +import {GitRepoDialogComponent} from "../git-repo-dialog/git-repo-dialog.component"; export class MdDialogMock { @@ -519,7 +520,10 @@ describe('WorkflowSpecListComponent', () => { const gitPushSpy = spyOn((component as any), 'gitPush').and.stub(); const dialogSpy = spyOn(component.dialog, 'open') .and.returnValue({afterClosed: () => of (mockComment)} as any); + component.gitPush(); + expect(gitPushSpy).toHaveBeenCalled(); + expect(dialogSpy).toHaveBeenCalled(); }); diff --git a/src/app/workflow-spec-list/workflow-spec-list.component.ts b/src/app/workflow-spec-list/workflow-spec-list.component.ts index 915495e..94cea24 100644 --- a/src/app/workflow-spec-list/workflow-spec-list.component.ts +++ b/src/app/workflow-spec-list/workflow-spec-list.component.ts @@ -72,6 +72,10 @@ export class WorkflowSpecListComponent implements OnInit { } ngOnInit() { + this.api.gitRepo().subscribe(gitRepo => { + this.gitRepo = gitRepo; + }); + this.route.paramMap.subscribe(paramMap => { if (paramMap.has('spec')) { this._loadWorkflowSpecCategories(paramMap.get('spec')); @@ -80,10 +84,6 @@ export class WorkflowSpecListComponent implements OnInit { } }); - this.api.gitRepo().subscribe(gitRepo => { - this.gitRepo = gitRepo; - }) - this.searchField = new FormControl(); this.searchField.valueChanges.subscribe(value => { this._loadWorkflowSpecs(null, value);