mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
Fix tests
PaginationComponent: expected arguments of updateRoute were out of sync with (fixed) types GroupFormComponent: groupBeingEdited is never set to null
This commit is contained in:
@@ -39,8 +39,8 @@
|
||||
<button (click)="onCancel()"
|
||||
class="btn btn-outline-secondary"><i class="fas fa-arrow-left"></i> {{messagePrefix + '.return' | translate}}</button>
|
||||
</div>
|
||||
<div after *ngIf="groupBeingEdited !== null" class="btn-group">
|
||||
<button class="btn btn-danger delete-button" [disabled]="(canEdit$ | async) === false || groupBeingEdited.permanent"
|
||||
<div after *ngIf="groupBeingEdited !== undefined" class="btn-group">
|
||||
<button class="btn btn-danger delete-button" [disabled]="(canEdit$ | async) === false || groupBeingEdited?.permanent"
|
||||
(click)="delete()">
|
||||
<i class="fa fa-trash"></i> {{ messagePrefix + '.actions.delete' | translate}}
|
||||
</button>
|
||||
@@ -48,10 +48,10 @@
|
||||
</ds-form>
|
||||
|
||||
<div class="mb-5">
|
||||
<ds-members-list *ngIf="groupBeingEdited !== null"
|
||||
<ds-members-list *ngIf="groupBeingEdited !== undefined"
|
||||
[messagePrefix]="messagePrefix + '.members-list'"></ds-members-list>
|
||||
</div>
|
||||
<ds-subgroups-list *ngIf="groupBeingEdited !== null"
|
||||
<ds-subgroups-list *ngIf="groupBeingEdited !== undefined"
|
||||
[messagePrefix]="messagePrefix + '.subgroups-list'"></ds-subgroups-list>
|
||||
|
||||
|
||||
|
@@ -282,11 +282,11 @@ describe('Pagination component', () => {
|
||||
|
||||
changePage(testFixture, 3);
|
||||
tick();
|
||||
expect(paginationService.updateRoute).toHaveBeenCalledWith('test', Object.assign({ page: '3' }), {}, false);
|
||||
expect(paginationService.updateRoute).toHaveBeenCalledWith('test', Object.assign({ page: 3 }), {}, false);
|
||||
|
||||
changePage(testFixture, 0);
|
||||
tick();
|
||||
expect(paginationService.updateRoute).toHaveBeenCalledWith('test', Object.assign({ page: '2' }), {}, false);
|
||||
expect(paginationService.updateRoute).toHaveBeenCalledWith('test', Object.assign({ page: 2 }), {}, false);
|
||||
}));
|
||||
|
||||
it('should set correct pageSize route parameters', fakeAsync(() => {
|
||||
@@ -296,7 +296,7 @@ describe('Pagination component', () => {
|
||||
|
||||
changePageSize(testFixture, '20');
|
||||
tick();
|
||||
expect(paginationService.updateRoute).toHaveBeenCalledWith('test', Object.assign({ pageId: 'test', page: 1, pageSize: 20 }), {}, false);
|
||||
expect(paginationService.updateRoute).toHaveBeenCalledWith('test', Object.assign({ page: 1, pageSize: 20 }), {}, false);
|
||||
}));
|
||||
|
||||
it('should respond to windows resize', () => {
|
||||
|
Reference in New Issue
Block a user