Skip to content

Commit 18d512a

Browse files
committed
Update courses-card-list.component.spec.ts
1 parent 4cf47ed commit 18d512a

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

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

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ describe("CoursesCardListComponent", () => {
1717
// will bring lots of feature which will be needed to test the component
1818
let fixture: ComponentFixture<CoursesCardListComponent>;
1919

20+
let el: DebugElement;
21+
2022
//init our test
2123
// async is going to wait for this asynchornou operation triggered by the below code and async is going to wait for 5 sec
2224
beforeEach(async () => {
@@ -32,6 +34,8 @@ describe("CoursesCardListComponent", () => {
3234
fixture = TestBed.createComponent(CoursesCardListComponent);
3335

3436
component = fixture.componentInstance;
37+
38+
el = fixture.debugElement;
3539
});
3640
});
3741

@@ -44,7 +48,15 @@ describe("CoursesCardListComponent", () => {
4448
});
4549

4650
it("should display the course list", () => {
47-
pending();
51+
// pending();
52+
53+
component.courses = setupCourses();
54+
55+
const cards = el.queryAll(By.css(".course-card"));
56+
57+
expect(cards).toBeTruthy("Could not find cards");
58+
59+
expect(cards.length).toBe(12, "Unexpected number of courses");
4860
});
4961

5062
it("should display the first course", () => {

0 commit comments

Comments
 (0)