Skip to content

Commit 6df41cf

Browse files
committed
Update courses-card-list.component.spec.ts
1 parent 1fb793c commit 6df41cf

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

src/app/courses/courses-card-list/courses-card-list.component.spec.ts

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,25 @@ describe("CoursesCardListComponent", () => {
6565
});
6666

6767
it("should display the first course", () => {
68-
pending();
68+
// pending();
69+
70+
component.courses = setupCourses();
71+
72+
fixture.detectChanges();
73+
74+
const course = component.courses[0];
75+
76+
const card = el.query(By.css(".course-card:first-child"));
77+
78+
const title = card.query(By.css("mat-card-title"));
79+
80+
const image = card.query(By.css("img"));
81+
82+
//assertion
83+
expect(card).toBeTruthy("Could not find course card");
84+
85+
expect(title.nativeElement.textContent).toBe(course.titles.description);
86+
87+
expect(image.nativeElement.src).toBe(course.iconUrl);
6988
});
7089
});

0 commit comments

Comments
 (0)