[CST-9636] WIP Create unit tests

This commit is contained in:
Giuseppe Digilio
2023-05-10 20:18:20 +02:00
parent e31fc562c5
commit 64c0fff370
15 changed files with 382 additions and 53 deletions

View File

@@ -1,7 +1,7 @@
import { Component, Input, OnDestroy, OnInit } from '@angular/core';
import { BehaviorSubject, Subscription } from 'rxjs';
import { distinctUntilChanged, map } from 'rxjs/operators';
import { distinctUntilChanged, map, tap } from 'rxjs/operators';
import { SEARCH_CONFIG_SERVICE } from '../../../my-dspace-page/my-dspace-page.component';
import { SearchConfigurationService } from '../../../core/shared/search/search-configuration.service';
@@ -67,7 +67,8 @@ export class BulkAccessBrowseComponent implements OnInit, OnDestroy {
this.subs.push(
this.selectableListService.getSelectableList(this.listId).pipe(
distinctUntilChanged(),
map((list: SelectableListState) => this.generatePaginatedListBySelectedElements(list))
map((list: SelectableListState) => this.generatePaginatedListBySelectedElements(list)),
tap(console.log)
).subscribe(this.objectsSelected$)
)
}
@@ -76,14 +77,12 @@ export class BulkAccessBrowseComponent implements OnInit, OnDestroy {
this.paginationOptions$.next(Object.assign(new PaginationComponentOptions(), this.paginationOptions$.value, {
currentPage: this.paginationOptions$.value.currentPage + 1
}));
console.log(this.paginationOptions$.value);
}
pagePrev() {
this.paginationOptions$.next(Object.assign(new PaginationComponentOptions(), this.paginationOptions$.value, {
currentPage: this.paginationOptions$.value.currentPage - 1
}));
console.log(this.paginationOptions$.value);
}
private calculatePageCount(pageSize, totalCount = 0) {