more git stuff for tests

This commit is contained in:
alicia pritchett 2022-03-07 13:08:39 -05:00
parent 147853f79f
commit 6e29780f27
2 changed files with 8 additions and 4 deletions

View File

@ -37,6 +37,7 @@ import {
import {GetIconCodePipe} from '../_pipes/get-icon-code.pipe'; import {GetIconCodePipe} from '../_pipes/get-icon-code.pipe';
import {FileListComponent} from '../file-list/file-list.component'; import {FileListComponent} from '../file-list/file-list.component';
import {WorkflowSpecCategoryGroup, WorkflowSpecListComponent} from './workflow-spec-list.component'; import {WorkflowSpecCategoryGroup, WorkflowSpecListComponent} from './workflow-spec-list.component';
import {GitRepoDialogComponent} from "../git-repo-dialog/git-repo-dialog.component";
export class MdDialogMock { export class MdDialogMock {
@ -519,7 +520,10 @@ describe('WorkflowSpecListComponent', () => {
const gitPushSpy = spyOn((component as any), 'gitPush').and.stub(); const gitPushSpy = spyOn((component as any), 'gitPush').and.stub();
const dialogSpy = spyOn(component.dialog, 'open') const dialogSpy = spyOn(component.dialog, 'open')
.and.returnValue({afterClosed: () => of (mockComment)} as any); .and.returnValue({afterClosed: () => of (mockComment)} as any);
component.gitPush(); component.gitPush();
expect(gitPushSpy).toHaveBeenCalled();
expect(dialogSpy).toHaveBeenCalled();
}); });

View File

@ -72,6 +72,10 @@ export class WorkflowSpecListComponent implements OnInit {
} }
ngOnInit() { ngOnInit() {
this.api.gitRepo().subscribe(gitRepo => {
this.gitRepo = gitRepo;
});
this.route.paramMap.subscribe(paramMap => { this.route.paramMap.subscribe(paramMap => {
if (paramMap.has('spec')) { if (paramMap.has('spec')) {
this._loadWorkflowSpecCategories(paramMap.get('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 = new FormControl();
this.searchField.valueChanges.subscribe(value => { this.searchField.valueChanges.subscribe(value => {
this._loadWorkflowSpecs(null, value); this._loadWorkflowSpecs(null, value);