File tree 1 file changed +10
-4
lines changed
1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -100,7 +100,7 @@ describe('HomeComponent', () => {
100
100
} ) ;
101
101
102
102
103
- it ( "should display advanced courses when tab clicked" , ( ) => {
103
+ it ( "should display advanced courses when tab clicked" , ( done : DoneFn ) => {
104
104
105
105
coursesService . findAllCourses . and . returnValue ( of ( setupCourses ( ) ) ) ;
106
106
@@ -112,11 +112,17 @@ describe('HomeComponent', () => {
112
112
113
113
fixture . detectChanges ( ) ;
114
114
115
- const cardTitles = el . queryAll ( By . css ( '.mat-card-title' ) ) ;
115
+ setTimeout ( ( ) => {
116
116
117
- expect ( cardTitles . length ) . toBeGreaterThan ( 0 , "Could not find card titles" ) ;
117
+ const cardTitles = el . queryAll ( By . css ( '.mat- card-title' ) ) ;
118
118
119
- expect ( cardTitles [ 0 ] . nativeElement . textContent ) . toContain ( "Angular Security Course" ) ;
119
+ expect ( cardTitles . length ) . toBeGreaterThan ( 0 , "Could not find card titles" ) ;
120
+
121
+ expect ( cardTitles [ 0 ] . nativeElement . textContent ) . toContain ( "Angular Security Course" ) ;
122
+
123
+ done ( ) ;
124
+
125
+ } , 500 ) ;
120
126
121
127
} ) ;
122
128
You can’t perform that action at this time.
0 commit comments