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 0a9c544..a126aa1 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 @@ -223,7 +223,7 @@ describe('WorkflowSpecListComponent', () => { const _addWorkflowSpecCategorySpy = spyOn((component as any), '_addWorkflowSpecCategory').and.stub(); const _updateWorkflowSpecCategorySpy = spyOn((component as any), '_updateWorkflowSpecCategory').and.stub(); - component.selectedSpec = undefined; + component.selectedCat = undefined; (component as any)._upsertWorkflowSpecCategory(mockWorkflowSpecCategory1 as WorkflowSpecCategoryDialogData); expect(_addWorkflowSpecCategorySpy).toHaveBeenCalled(); expect(_updateWorkflowSpecCategorySpy).not.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 68f06bd..e56f9e5 100644 --- a/src/app/workflow-spec-list/workflow-spec-list.component.ts +++ b/src/app/workflow-spec-list/workflow-spec-list.component.ts @@ -172,7 +172,7 @@ export class WorkflowSpecListComponent implements OnInit { } private _upsertWorkflowSpecCategory(data: WorkflowSpecCategoryDialogData) { - if (data.id && data.name && data.display_name) { + if (isNumberDefined(data.id) && data.name && data.display_name) { // Save old workflow spec id, in case it's changed const catId = this.selectedCat ? this.selectedCat.id : undefined; @@ -183,7 +183,7 @@ export class WorkflowSpecListComponent implements OnInit { display_name: data.display_name, }; - if (catId) { + if (isNumberDefined(catId)) { this._updateWorkflowSpecCategory(catId, newCat); } else { this._addWorkflowSpecCategory(newCat);