fixes tests. some style choices

This commit is contained in:
alicia pritchett 2021-10-13 11:17:45 -04:00
parent e242aeebf3
commit d63d648838
5 changed files with 12 additions and 5 deletions

View File

@ -1,5 +1,5 @@
<div mat-dialog-title *ngIf="data && data.category">
Delete category <strong>{{data.category.id}}</strong>?
Delete category <strong>{{data.category.display_name}}</strong>?
<button mat-icon-button mat-dialog-close=""><mat-icon>close</mat-icon></button>
</div>
<div mat-dialog-content>

View File

@ -1,7 +1,11 @@
<div mat-dialog-title>
<div *ngIf="!this.data.library" mat-dialog-title>
<h1>Workflow Specification</h1>
</div>
<div *ngIf="this.data.library" mat-dialog-title>
<h1>Library Specification</h1>
</div>
<div mat-dialog-content>
<form [formGroup]="form">
<formly-form [model]="model" [fields]="fields" [options]="options" [form]="form"></formly-form>

View File

@ -4,7 +4,7 @@
<h1 style="margin-top: 16px">Workflow Specifications</h1>
</div>
<mat-form-field class="search-field">
<label><input matInput type="search" placeholder="Search Workflows" fxLayoutAlign="start" class="form-control" [formControl]="searchField"></label>
<label><input matInput type="search" placeholder="Search Workflows" fxLayoutAlign="start" style="margin-top: 0;" class="form-control" [formControl]="searchField"></label>
</mat-form-field>
</div>
<mat-drawer-container class="example-container" autosize>
@ -27,7 +27,6 @@
<h4 style="margin-top: 5px">Library Specs</h4>
<button id="add_spec" title="Add new Library" mat-flat-button color="primary" (click)="editWorkflowSpec('library')" fxLayoutAlign="auto">
<mat-icon>library_add</mat-icon>
</button>
</div>
<mat-divider></mat-divider>

View File

@ -199,6 +199,7 @@ describe('WorkflowSpecListComponent', () => {
it('should add a workflow spec', () => {
const _loadWorkflowSpecsSpy = spyOn((component as any), '_loadWorkflowSpecs').and.stub();
const _loadWorkflowLibrariesSpy = spyOn((component as any), '_loadWorkflowLibraries').and.stub();
const _displayMessageSpy = spyOn((component as any), '_displayMessage').and.stub();
(component as any)._addWorkflowSpec(mockWorkflowSpec0);
const wfsReq = httpMock.expectOne(`apiRoot/workflow-specification`);
@ -206,6 +207,7 @@ describe('WorkflowSpecListComponent', () => {
wfsReq.flush(mockWorkflowSpec0);
expect(_loadWorkflowSpecsSpy).toHaveBeenCalled();
expect(_loadWorkflowLibrariesSpy).toHaveBeenCalled();
expect(_displayMessageSpy).toHaveBeenCalled();
});
@ -248,12 +250,14 @@ describe('WorkflowSpecListComponent', () => {
it('should delete a workflow spec', () => {
const loadWorkflowSpecsSpy = spyOn((component as any), '_loadWorkflowSpecs').and.stub();
const _loadWorkflowLibrariesSpy = spyOn((component as any), '_loadWorkflowLibraries').and.stub();
(component as any)._deleteWorkflowSpec(mockWorkflowSpec0);
const wfsReq = httpMock.expectOne(`apiRoot/workflow-specification/${mockWorkflowSpec0.id}`);
expect(wfsReq.request.method).toEqual('DELETE');
wfsReq.flush(null);
expect(loadWorkflowSpecsSpy).toHaveBeenCalled();
expect(_loadWorkflowLibrariesSpy).toHaveBeenCalled();
});
it('should show a metadata dialog when editing a workflow spec category', () => {

View File

@ -392,7 +392,7 @@ export class WorkflowSpecListComponent implements OnInit {
private _deleteWorkflowSpecCategory(workflowSpecCategory: WorkflowSpecCategory) {
this.api.deleteWorkflowSpecCategory(workflowSpecCategory.id).subscribe(() => {
this._loadWorkflowSpecCategories();
this._displayMessage(`Deleted workflow spec category ${workflowSpecCategory.id}.`);
this._displayMessage(`Deleted workflow spec category ${workflowSpecCategory.display_name}.`);
});
}