fix(collapse-series): fix series collapsing (#541)
This commit is contained in:
@@ -439,6 +439,17 @@ describe('BookBrowserComponent', () => {
|
||||
expect(component.showTableLoadingPlaceholder()).toBe(false);
|
||||
});
|
||||
|
||||
it('calls SeriesCollapseFilter.collapseBooks when computing pipelineInputs', () => {
|
||||
createHarness();
|
||||
const filter = TestBed.inject(SeriesCollapseFilter);
|
||||
const collapseBooksSpy = vi.spyOn(filter, 'collapseBooks');
|
||||
|
||||
vi.runOnlyPendingTimers();
|
||||
TestBed.flushEffects();
|
||||
|
||||
expect(collapseBooksSpy).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('triggers next page fetch when scrolled near the bottom of rendered content', async () => {
|
||||
const {component} = createHarness();
|
||||
const appBooksApi = TestBed.inject(AppBooksApiService);
|
||||
|
||||
@@ -264,7 +264,10 @@ export class BookBrowserComponent implements OnInit, AfterViewInit, OnDestroy {
|
||||
return Number.isNaN(entityId) ? entityType : `${entityType}:${entityId}`;
|
||||
});
|
||||
|
||||
private readonly pipelineInputs = computed(() => this.appBooksApi.books());
|
||||
private readonly pipelineInputs = computed(() => {
|
||||
const books = this.appBooksApi.books();
|
||||
return this.seriesCollapseFilter.collapseBooks(books, this.forceExpandSeries());
|
||||
});
|
||||
|
||||
private readonly renderBooksEffect = effect((onCleanup) => {
|
||||
const contextKey = this.booksContextKey();
|
||||
|
||||
Reference in New Issue
Block a user