File tree Expand file tree Collapse file tree 5 files changed +15
-31
lines changed Expand file tree Collapse file tree 5 files changed +15
-31
lines changed Original file line number Diff line number Diff line change 55context ( 'Sidebar' , ( ) => {
66 beforeEach ( ( ) => {
77 cy . visit ( '/' ) ;
8+ cy . contains ( 'Progress' ) . should ( 'exist' ) ;
89 } ) ;
910
10- it ( 'does something' , ( ) => {
11- cy . contains ( 'YDKJS Exercises' ) ;
11+ it ( 'closes when X is clicked and reopens when hamburger is clicked' , ( ) => {
12+ cy . get ( '[data-testid=closeSidebar]' ) . click ( ) ;
13+ cy . contains ( 'Progress' ) . should ( 'not.exist' ) ;
14+ cy . get ( '[data-testid=openSidebar]' ) . click ( ) ;
15+ cy . contains ( 'Progress' ) . should ( 'exist' ) ;
16+ } ) ;
17+
18+ it ( 'navigates to /up-going when Up & Going is picked' , ( ) => {
19+ cy . contains ( / U p & G o i n g \( / ) . click ( { force : true } ) ;
20+ cy . url ( ) . should ( 'include' , '/up-going' ) ;
21+ cy . contains ( 'Chapter 1: Into Programming' ) . should ( 'exist' ) ;
22+ cy . contains ( 'Chapter 2: Into JavaScript' ) . should ( 'exist' ) ;
1223 } ) ;
1324} ) ;
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -69,6 +69,7 @@ export default class Sidebar extends Component {
6969 border : 0 ,
7070 background : 'transparent' ,
7171 } }
72+ data-testid = "openSidebar"
7273 >
7374 < Menu />
7475 </ button >
@@ -87,6 +88,7 @@ export default class Sidebar extends Component {
8788 position : 'absolute' ,
8889 right : '10px' ,
8990 } }
91+ data-testid = "closeSidebar"
9092 >
9193 < Close data-name = "svg" />
9294 </ button >
You can’t perform that action at this time.
0 commit comments