Skip to content

Commit

Permalink
fix router behaviour for student page
Browse files Browse the repository at this point in the history
  • Loading branch information
JohannesWt committed Oct 30, 2024
1 parent d38aab5 commit 25713ac
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export class LearningPathStudentPageComponent {

readonly isLearningPathLoading = signal(false);
readonly learningPath = signal<LearningPathDTO | undefined>(undefined);
readonly courseId = toSignal(this.activatedRoute.parent!.parent!.params.pipe(map((params) => Number(params.courseId))), { requireSync: true });
readonly courseId = toSignal(this.activatedRoute.parent!.params.pipe(map((params) => Number(params.courseId))), { requireSync: true });
readonly currentLearningObject = this.learningPathNavigationService.currentLearningObject;
readonly isLearningPathNavigationLoading = this.learningPathNavigationService.isLoading;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { AlertService } from 'app/core/util/alert.service';
import { MockAlertService } from '../../../helpers/mocks/service/mock-alert.service';
import { EntityNotFoundError } from 'app/course/learning-paths/exceptions/entity-not-found.error';
import { LearningPathDTO } from 'app/entities/competency/learning-path.model';
import { provideHttpClientTesting } from '@angular/common/http/testing';

describe('LearningPathStudentPageComponent', () => {
let component: LearningPathStudentPageComponent;
Expand All @@ -33,15 +34,14 @@ describe('LearningPathStudentPageComponent', () => {
imports: [LearningPathStudentPageComponent],
providers: [
provideHttpClient(),
provideHttpClientTesting(),
{
provide: ActivatedRoute,
useValue: {
parent: {
parent: {
params: of({
courseId: courseId,
}),
},
params: of({
courseId: courseId,
}),
},
},
},
Expand Down

0 comments on commit 25713ac

Please sign in to comment.