Skip to content

Commit 2cad56c

Browse files
committed
Fix tests
PaginationComponent: expected arguments of updateRoute were out of sync with (fixed) types GroupFormComponent: groupBeingEdited is never set to null
1 parent 0633460 commit 2cad56c

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

src/app/access-control/group-registry/group-form/group-form.component.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,19 +39,19 @@ <h2 class="border-bottom pb-2">
3939
<button (click)="onCancel()"
4040
class="btn btn-outline-secondary"><i class="fas fa-arrow-left"></i> {{messagePrefix + '.return' | translate}}</button>
4141
</div>
42-
<div after *ngIf="groupBeingEdited !== null" class="btn-group">
43-
<button class="btn btn-danger delete-button" [disabled]="(canEdit$ | async) === false || groupBeingEdited.permanent"
42+
<div after *ngIf="groupBeingEdited !== undefined" class="btn-group">
43+
<button class="btn btn-danger delete-button" [disabled]="(canEdit$ | async) === false || groupBeingEdited?.permanent"
4444
(click)="delete()">
4545
<i class="fa fa-trash"></i> {{ messagePrefix + '.actions.delete' | translate}}
4646
</button>
4747
</div>
4848
</ds-form>
4949

5050
<div class="mb-5">
51-
<ds-members-list *ngIf="groupBeingEdited !== null"
51+
<ds-members-list *ngIf="groupBeingEdited !== undefined"
5252
[messagePrefix]="messagePrefix + '.members-list'"></ds-members-list>
5353
</div>
54-
<ds-subgroups-list *ngIf="groupBeingEdited !== null"
54+
<ds-subgroups-list *ngIf="groupBeingEdited !== undefined"
5555
[messagePrefix]="messagePrefix + '.subgroups-list'"></ds-subgroups-list>
5656

5757

src/app/shared/pagination/pagination.component.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -282,11 +282,11 @@ describe('Pagination component', () => {
282282

283283
changePage(testFixture, 3);
284284
tick();
285-
expect(paginationService.updateRoute).toHaveBeenCalledWith('test', Object.assign({ page: '3' }), {}, false);
285+
expect(paginationService.updateRoute).toHaveBeenCalledWith('test', Object.assign({ page: 3 }), {}, false);
286286

287287
changePage(testFixture, 0);
288288
tick();
289-
expect(paginationService.updateRoute).toHaveBeenCalledWith('test', Object.assign({ page: '2' }), {}, false);
289+
expect(paginationService.updateRoute).toHaveBeenCalledWith('test', Object.assign({ page: 2 }), {}, false);
290290
}));
291291

292292
it('should set correct pageSize route parameters', fakeAsync(() => {
@@ -296,7 +296,7 @@ describe('Pagination component', () => {
296296

297297
changePageSize(testFixture, '20');
298298
tick();
299-
expect(paginationService.updateRoute).toHaveBeenCalledWith('test', Object.assign({ pageId: 'test', page: 1, pageSize: 20 }), {}, false);
299+
expect(paginationService.updateRoute).toHaveBeenCalledWith('test', Object.assign({ page: 1, pageSize: 20 }), {}, false);
300300
}));
301301

302302
it('should respond to windows resize', () => {

0 commit comments

Comments
 (0)