diff --git a/AdminWebsite/AdminWebsite/ClientApp/src/app/booking/participant/list/participant-list.component.ts b/AdminWebsite/AdminWebsite/ClientApp/src/app/booking/participant/list/participant-list.component.ts index 77e758637..ccab19f16 100644 --- a/AdminWebsite/AdminWebsite/ClientApp/src/app/booking/participant/list/participant-list.component.ts +++ b/AdminWebsite/AdminWebsite/ClientApp/src/app/booking/participant/list/participant-list.component.ts @@ -27,8 +27,8 @@ export class ParticipantListComponent implements OnInit, OnChanges, DoCheck { constructor(private logger: Logger, private videoHearingsService: VideoHearingsService) {} ngDoCheck(): void { - const participantsLocal = [...this.hearing?.participants || []].sort(this.sortByDisplayName()); - const sortedParticipantslocal = [...this.sortedParticipants || []].sort(this.sortByDisplayName()); + const participantsLocal = [...(this.hearing?.participants || [])].sort(this.sortByDisplayName()); + const sortedParticipantslocal = [...(this.sortedParticipants || [])].sort(this.sortByDisplayName()); const hasParticipantListChanged = JSON.stringify(participantsLocal) !== JSON.stringify(sortedParticipantslocal); if (hasParticipantListChanged) { this.sortParticipants(); diff --git a/AdminWebsite/AdminWebsite/ClientApp/src/app/services/video-hearings.service.spec.ts b/AdminWebsite/AdminWebsite/ClientApp/src/app/services/video-hearings.service.spec.ts index b177b84ac..96545ae1f 100644 --- a/AdminWebsite/AdminWebsite/ClientApp/src/app/services/video-hearings.service.spec.ts +++ b/AdminWebsite/AdminWebsite/ClientApp/src/app/services/video-hearings.service.spec.ts @@ -622,7 +622,6 @@ describe('Video hearing service', () => { describe('addJudiciaryJudge', () => { it('should add a new judge when none exists', () => { // Arrange - const service = new VideoHearingsService(clientApiSpy); const judicialMember = new JudicialMemberDto('Test', 'User', 'Test User', 'test@test.com', '1234567890', '1234'); spyOn(service['modelHearing'].judiciaryParticipants, 'findIndex').and.returnValue(-1); @@ -636,7 +635,6 @@ describe('Video hearing service', () => { it('should replace an existing judge', () => { // Arrange - const service = new VideoHearingsService(clientApiSpy); const newJudge = new JudicialMemberDto('Test', 'User', 'Test User', 'test@test.com', '1234567890', '1234'); const existingJudge = new JudicialMemberDto('Test', 'User', 'Test User', 'test@test.com', '1234567890', '5678'); service['modelHearing'].judiciaryParticipants.push(existingJudge);