We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2d88a89 commit c5fa13cCopy full SHA for c5fa13c
src/app/courses/services/courses.service.spec.ts
@@ -3,7 +3,7 @@ import {
3
HttpTestingController,
4
} from "@angular/common/http/testing";
5
import { TestBed } from "@angular/core/testing";
6
-import { COURSES } from "../../../../server/db-data";
+import { COURSES, findCourseById } from '../../../../server/db-data';
7
import { CoursesService } from "./courses.service";
8
describe("CoursesService", () => {
9
let coursesService: CoursesService,
@@ -34,4 +34,12 @@ describe("CoursesService", () => {
34
// passing some test data to our mock request
35
req.flush({ payload: Object.values(COURSES) });
36
});
37
+
38
+ it("should find a course by id", () => {
39
+ coursesService.findCourseById(12).subscribe((course) => {
40
+ expect(course).toBeTruthy("No courses returned");
41
+ expect(course.id).toBe(12, "incorrect course id");
42
43
44
+ });
45
0 commit comments