@@ -93,13 +93,18 @@ describe("whitelisted courses", () => {
9393 cy . contains ( ".csm-btn" , / c s 6 1 a / i) . should ( "be.visible" ) ;
9494
9595 // view unrestricted courses; should show nothing
96- cy . contains ( ".course-menu-sidebar-tab" , / u n r e s t r i c t e d / i) . click ( ) ;
96+ cy . contains ( ".course-menu-sidebar-tab" , / u n r e s t r i c t e d / i) . clickUntil ( $el => {
97+ expect ( $el ) . to . have . class ( "active" ) ;
98+ } ) ;
9799 cy . contains ( ".course-menu-sidebar-tab" , / u n r e s t r i c t e d / i) . should ( "have.class" , "active" ) ;
98100 cy . contains ( ".csm-btn" , / c s 6 1 a / i) . should ( "not.exist" ) ;
99101
100102 // go to cs61a sections
101- cy . contains ( ".course-menu-sidebar-tab" , / r e s t r i c t e d / i) . click ( ) ;
103+ cy . contains ( ".course-menu-sidebar-tab" , / r e s t r i c t e d / i) . clickUntil ( $el => {
104+ expect ( $el ) . to . have . class ( "active" ) ;
105+ } ) ;
102106 cy . contains ( ".course-menu-sidebar-tab" , / r e s t r i c t e d / i) . should ( "have.class" , "active" ) ;
107+
103108 cy . contains ( ".csm-btn" , / c s 6 1 a / i) . click ( ) ;
104109 cy . get ( ".section-card" ) . should ( "have.length" , 1 ) . should ( "be.visible" ) ;
105110
@@ -143,13 +148,17 @@ describe("whitelisted courses", () => {
143148 cy . contains ( ".csm-btn" , / c s 7 0 / i) . should ( "not.exist" ) ;
144149
145150 // view unrestricted courses; should show cs70, but not cs61a
146- cy . contains ( ".course-menu-sidebar-tab" , / u n r e s t r i c t e d / i) . click ( ) ;
151+ cy . contains ( ".course-menu-sidebar-tab" , / u n r e s t r i c t e d / i) . clickUntil ( $el => {
152+ expect ( $el ) . to . have . class ( "active" ) ;
153+ } ) ;
147154 cy . contains ( ".course-menu-sidebar-tab" , / u n r e s t r i c t e d / i) . should ( "have.class" , "active" ) ;
148155 cy . contains ( ".csm-btn" , / c s 6 1 a / i) . should ( "not.exist" ) ;
149156 cy . contains ( ".csm-btn" , / c s 7 0 / i) . should ( "be.visible" ) ;
150157
151158 // go to cs61a sections
152- cy . contains ( ".course-menu-sidebar-tab" , / r e s t r i c t e d / i) . click ( ) ;
159+ cy . contains ( ".course-menu-sidebar-tab" , / r e s t r i c t e d / i) . clickUntil ( $el => {
160+ expect ( $el ) . to . have . class ( "active" ) ;
161+ } ) ;
153162 cy . contains ( ".course-menu-sidebar-tab" , / r e s t r i c t e d / i) . should ( "have.class" , "active" ) ;
154163 cy . contains ( ".csm-btn" , / c s 6 1 a / i) . click ( ) ;
155164 cy . get ( ".section-card" ) . should ( "have.length" , 1 ) . should ( "be.visible" ) ;
@@ -225,15 +234,19 @@ describe("whitelisted courses", () => {
225234 cy . contains ( ".enrollment-container .enrollment-course" , / c s 6 1 a / i) . should ( "be.visible" ) ;
226235
227236 // view unrestricted courses; should show cs70, but not cs61a
228- cy . contains ( ".course-menu-sidebar-tab" , / u n r e s t r i c t e d / i) . click ( ) ;
237+ cy . contains ( ".course-menu-sidebar-tab" , / u n r e s t r i c t e d / i) . clickUntil ( $el => {
238+ expect ( $el ) . to . have . class ( "active" ) ;
239+ } ) ;
229240 cy . contains ( ".course-menu-sidebar-tab" , / u n r e s t r i c t e d / i) . should ( "have.class" , "active" ) ;
230241 cy . contains ( ".csm-btn" , / c s 6 1 a / i) . should ( "not.exist" ) ;
231242 cy . contains ( ".csm-btn" , / c s 7 0 / i) . should ( "be.visible" ) ;
232243 // should not show any enrollment times
233244 cy . get ( ".enrollment-container" ) . should ( "not.exist" ) ;
234245
235246 // go to cs61a sections
236- cy . contains ( ".course-menu-sidebar-tab" , / r e s t r i c t e d / i) . click ( ) ;
247+ cy . contains ( ".course-menu-sidebar-tab" , / r e s t r i c t e d / i) . clickUntil ( $el => {
248+ expect ( $el ) . to . have . class ( "active" ) ;
249+ } ) ;
237250 cy . contains ( ".course-menu-sidebar-tab" , / r e s t r i c t e d / i) . should ( "have.class" , "active" ) ;
238251 cy . contains ( ".csm-btn" , / c s 6 1 a / i) . click ( ) ;
239252 cy . get ( ".section-card" ) . should ( "have.length" , 1 ) . should ( "be.visible" ) ;
0 commit comments