mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-28 22:42:11 +01:00
Merged PR 55: Fix bug with neg. skip and update remi library to handle missing required-capacities result
+ Package Update ISA Remi Library to 0.3.12 + Set Skip on fetch last products to minimum 0 Related work items: #467
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { RemissionListComponent } from './remission-list.component';
|
||||
import { of } from 'rxjs';
|
||||
|
||||
describe('RemissionListComponent', () => {
|
||||
let component: RemissionListComponent;
|
||||
@@ -15,6 +16,20 @@ describe('RemissionListComponent', () => {
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(RemissionListComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
describe('subscribeToFetchLastProducts', () => {
|
||||
component.pageSize = 10;
|
||||
component.totalHits = 9
|
||||
component.products = []
|
||||
|
||||
it('should call fetchProductsBySkipAndTake', () => {
|
||||
spyOn(component, 'fetchProductsBySkipAndTake').and.callFake(() => of())
|
||||
|
||||
component.fetchLastProducts$.next()
|
||||
fixture.detectChanges()
|
||||
|
||||
expect(component.fetchProductsBySkipAndTake).toHaveBeenCalledWith(0, 10)
|
||||
})
|
||||
})
|
||||
});
|
||||
|
||||
@@ -107,7 +107,7 @@ export class RemissionListComponent implements OnInit, OnDestroy {
|
||||
this.fetchLastProducts$.pipe(takeUntil(this.destroy$)).subscribe(_ => {
|
||||
// Increase number of takes to show all residual products (currently: 10)
|
||||
const takeParam = this.pageSize;
|
||||
const skipParam = this.totalHits - takeParam;
|
||||
const skipParam = Math.max(0, this.totalHits - takeParam);
|
||||
|
||||
if (
|
||||
this.products.length >
|
||||
|
||||
6
package-lock.json
generated
6
package-lock.json
generated
@@ -1095,9 +1095,9 @@
|
||||
}
|
||||
},
|
||||
"@isa/remission": {
|
||||
"version": "0.3.11",
|
||||
"resolved": "https://pkgs.dev.azure.com/hugendubel/_packaging/hugendubel/npm/registry/@isa/remission/-/remission-0.3.11.tgz",
|
||||
"integrity": "sha1-7UuRwZHJvh8K8dXE0zJRDPBrotc=",
|
||||
"version": "0.3.12",
|
||||
"resolved": "https://pkgs.dev.azure.com/hugendubel/_packaging/hugendubel/npm/registry/@isa/remission/-/remission-0.3.12.tgz",
|
||||
"integrity": "sha1-G8wLRnJjfAS18j+I7+AxB2T8Vl0=",
|
||||
"requires": {
|
||||
"tslib": "^1.9.0"
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
"@isa/catsearch-api": "^0.0.53",
|
||||
"@isa/print-api": "0.0.53",
|
||||
"@isa/remi-api": "^0.0.53",
|
||||
"@isa/remission": "^0.3.11",
|
||||
"@isa/remission": "^0.3.12",
|
||||
"@ng-idle/core": "^8.0.0-beta.4",
|
||||
"@ng-idle/keepalive": "^8.0.0-beta.4",
|
||||
"@ngxs/store": "^3.4.1",
|
||||
|
||||
Reference in New Issue
Block a user