Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<h1 id="header" class="border-bottom pb-2">{{ "admin.reports.collections.head" | translate }}</h1>

<div id="metadatadiv">
<ngb-accordion [closeOthers]="true" activeIds="filters" #acc="ngbAccordion">
<ngb-accordion [closeOthers]="false" activeIds="filters" #acc="ngbAccordion">
<ngb-panel id="filters">
<ng-template ngbPanelTitle>
{{ "admin.reports.commons.filters" | translate }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ describe('FiltersComponent', () => {
spyOn(component, 'getFilteredCollections').and.returnValue(of(expected));
spyOn(component.results, 'deserialize');
spyOn(component.accordionComponent, 'expand').and.callThrough();
spyOn(component.accordionComponent, 'collapse').and.callThrough();
component.submit();
fixture.detectChanges();
});
Expand All @@ -93,5 +94,19 @@ describe('FiltersComponent', () => {
expect(component.accordionComponent.isExpanded('collections')).toBeTrue();
});
}));

it('should collapse the filters panel after submitting', waitForAsync(() => {
fixture.whenStable().then(() => {
expect(component.accordionComponent.isExpanded('filters')).toBeFalse();
});
}));
});

it('should allow both accordions to be open at the same time', () => {
let accordion: NgbAccordion = component.accordionComponent;
accordion.expand('filters');
accordion.expand('collections');
expect(accordion.isExpanded('filters')).toBeTrue();
expect(accordion.isExpanded('collections')).toBeTrue();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export class FilteredCollectionsComponent implements OnInit {
.subscribe(
response => {
this.results.deserialize(response.payload);
this.accordionComponent.collapse('filters'); // ← agregar esto
this.accordionComponent.expand('collections');
},
);
Expand Down
Loading