diff --git a/src/app/admin/admin-reports/filtered-collections/filtered-collections.component.html b/src/app/admin/admin-reports/filtered-collections/filtered-collections.component.html
index c696fa23ba2..ec9f8baf86b 100644
--- a/src/app/admin/admin-reports/filtered-collections/filtered-collections.component.html
+++ b/src/app/admin/admin-reports/filtered-collections/filtered-collections.component.html
@@ -5,7 +5,7 @@
-
+
{{ "admin.reports.commons.filters" | translate }}
diff --git a/src/app/admin/admin-reports/filtered-collections/filtered-collections.component.spec.ts b/src/app/admin/admin-reports/filtered-collections/filtered-collections.component.spec.ts
index 40a4f18c7cf..6a3757ecd43 100644
--- a/src/app/admin/admin-reports/filtered-collections/filtered-collections.component.spec.ts
+++ b/src/app/admin/admin-reports/filtered-collections/filtered-collections.component.spec.ts
@@ -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();
});
@@ -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();
});
});
diff --git a/src/app/admin/admin-reports/filtered-collections/filtered-collections.component.ts b/src/app/admin/admin-reports/filtered-collections/filtered-collections.component.ts
index c300d9b9ca9..14b1f642362 100644
--- a/src/app/admin/admin-reports/filtered-collections/filtered-collections.component.ts
+++ b/src/app/admin/admin-reports/filtered-collections/filtered-collections.component.ts
@@ -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');
},
);