77
88describe ( "test" , ( ) => {
99 before ( ( ) => {
10- cy . visit ( "/api" ) ;
10+ cy . visit ( "/api/recursive " ) ;
1111 } ) ;
1212
1313 it ( "renders query parameters" , ( ) => {
@@ -20,15 +20,25 @@ describe("test", () => {
2020 return false ;
2121 } ) ;
2222
23- function checkTab ( tab : RegExp , heading : RegExp ) {
23+ function checkTab ( tab : RegExp , links : RegExp [ ] , heading : RegExp ) {
2424 cy . get ( ".navbar" ) . findByRole ( "link" , { name : tab } ) . click ( ) ;
25+
26+ for ( let link of links ) {
27+ cy . get ( "nav.menu" ) . findByRole ( "link" , { name : link } ) . click ( ) ;
28+ }
29+
2530 cy . findByRole ( "heading" , { name : heading , level : 1 } ) . should ( "exist" ) ;
2631 }
2732
28- checkTab ( / i s s u e 2 1 / i, / m i s s i n g s u m m a r y / i) ;
29- checkTab ( / c o s / i, / g e n e r a t i n g a n i a m t o k e n / i) ;
30- checkTab ( / y a m l / i, / h e l l o w o r l d / i) ;
31- checkTab ( / a p i / i, / r e c u r s i v e / i) ;
33+ checkTab ( / i s s u e 2 1 / i, [ ] , / m i s s i n g s u m m a r y / i) ;
34+ checkTab ( / c o s / i, [ ] , / g e n e r a t i n g a n i a m t o k e n / i) ;
35+ checkTab ( / y a m l / i, [ / a p i / i, / h e l l o w o r l d / i] , / h e l l o w o r l d / i) ;
36+ checkTab (
37+ / p e t s t o r e / i,
38+ [ / p e t / i, / a d d a n e w p e t t o t h e s t o r e / i] ,
39+ / a d d a n e w p e t t o t h e s t o r e / i
40+ ) ;
41+ checkTab ( / a p i / i, [ / ^ p e t $ / i, / r e c u r s i v e / i] , / r e c u r s i v e / i) ;
3242 } ) ;
3343
3444 it ( "loads a page with authentication" , ( ) => {
0 commit comments