File tree 1 file changed +42
-2
lines changed
1 file changed +42
-2
lines changed Original file line number Diff line number Diff line change 3
3
4
4
describe ( 'Home Page' , ( ) => {
5
5
6
- it ( 'should display a list of courses' , ( ) => {
6
+ beforeEach ( ( ) => {
7
7
8
8
cy . fixture ( 'courses.json' ) . as ( "coursesJSON" ) ;
9
9
@@ -13,6 +13,10 @@ describe('Home Page', () => {
13
13
14
14
cy . visit ( '/' ) ;
15
15
16
+ } ) ;
17
+
18
+ it ( 'should display a list of courses' , ( ) => {
19
+
16
20
cy . contains ( "All Courses" ) ;
17
21
18
22
cy . wait ( '@courses' ) ;
@@ -21,4 +25,40 @@ describe('Home Page', () => {
21
25
22
26
} ) ;
23
27
24
- } ) ;
28
+ it ( 'should display the advanced courses' , ( ) => {
29
+
30
+ cy . get ( '.mat-tab-label' ) . should ( "have.length" , 2 ) ;
31
+
32
+ cy . get ( '.mat-tab-label' ) . last ( ) . click ( ) ;
33
+
34
+ cy . get ( '.mat-tab-body-active .mat-card-title' ) . its ( 'length' ) . should ( 'be.gt' , 1 ) ;
35
+
36
+ cy . get ( '.mat-tab-body-active .mat-card-title' ) . first ( )
37
+ . should ( 'contain' , "Angular Security Course" ) ;
38
+
39
+ } ) ;
40
+
41
+
42
+ } ) ;
43
+
44
+
45
+
46
+
47
+
48
+
49
+
50
+
51
+
52
+
53
+
54
+
55
+
56
+
57
+
58
+
59
+
60
+
61
+
62
+
63
+
64
+
You can’t perform that action at this time.
0 commit comments