Skip to content
Snippets Groups Projects
Commit 5360d23d authored by Tifenn Guillas's avatar Tifenn Guillas
Browse files

Fix bug button add and delete cone search criteria

parent 20f887ce
No related branches found
No related tags found
2 merge requests!113Develop,!109Resolve "[cone-search] Ajout de l'option name resolver"
......@@ -60,7 +60,7 @@
<button class="btn btn-outline-success" *ngIf="!coneSearch" [hidden]="!isValid()" (click)="addConeSearch.emit(cs)">
<span class="fas fa-plus fa-fw"></span>
</button>
<button class="btn btn-outline-danger" *ngIf="coneSearch" (click)="deleteConeSearch.emit()">
<button class="btn btn-outline-danger" *ngIf="coneSearch" (click)="delConeSearch()">
<span class="fa fa-times fa-fw"></span>
</button>
</div>
......
......@@ -112,6 +112,18 @@ describe('[Search][Criteria] Component: ConeSearchTabComponent', () => {
testedComponent.delResolver();
});
it('raises the delete coneSearch, the delete resolver event and set cs to null', () => {
testedComponent.resolved = { name: 'toto', ra: 1, dec: 2};
testedComponent.deleteResolver.subscribe((event: any) => expect(event).toBeUndefined());
testedComponent.deleteConeSearch.subscribe((event: any) => expect(event).toBeUndefined());
testedComponent.delConeSearch();
});
it('raises the delete coneSearch and set cs to null', () => {
testedComponent.deleteConeSearch.subscribe((event: any) => expect(event).toBeUndefined());
testedComponent.delConeSearch();
});
it('should set resolved and cs', () => {
expect(testedComponent.cs).toEqual({ ra: null, dec: null, radius: null });
expect(testedComponent.resolved).toBeUndefined();
......
......@@ -66,4 +66,10 @@ export class ConeSearchTabComponent {
this.deleteResolver.emit();
}
}
delConeSearch(): void {
this.cs = { ra: null, dec: null, radius: null };
this.deleteConeSearch.emit();
this.delResolver();
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment