Skip to content

Commit 43325e6

Browse files
author
Your Name
committed
Angular Testing Course
1 parent fe69440 commit 43325e6

File tree

1 file changed

+34
-1
lines changed

1 file changed

+34
-1
lines changed

src/app/courses/home/home.component.spec.ts

+34-1
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,43 @@ describe('HomeComponent', () => {
102102

103103
it("should display advanced courses when tab clicked", () => {
104104

105-
pending();
105+
coursesService.findAllCourses.and.returnValue(of(setupCourses()));
106+
107+
fixture.detectChanges();
108+
109+
const tabs = el.queryAll(By.css(".mat-tab-label"));
110+
111+
click(tabs[1]);
112+
113+
fixture.detectChanges();
114+
115+
const cardTitles = el.queryAll(By.css('.mat-card-title'));
116+
117+
expect(cardTitles.length).toBeGreaterThan(0,"Could not find card titles");
118+
119+
expect(cardTitles[0].nativeElement.textContent).toContain("Angular Security Course");
106120

107121
});
108122

109123
});
110124

125+
126+
127+
128+
129+
130+
131+
132+
133+
134+
135+
136+
137+
138+
139+
140+
141+
142+
143+
111144

0 commit comments

Comments
 (0)