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 5
5
context ( 'Sidebar' , ( ) => {
6
6
beforeEach ( ( ) => {
7
7
cy . visit ( '/' ) ;
8
+ cy . contains ( 'Progress' ) . should ( 'exist' ) ;
8
9
} ) ;
9
10
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' ) ;
12
23
} ) ;
13
24
} ) ;
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 {
69
69
border : 0 ,
70
70
background : 'transparent' ,
71
71
} }
72
+ data-testid = "openSidebar"
72
73
>
73
74
< Menu />
74
75
</ button >
@@ -87,6 +88,7 @@ export default class Sidebar extends Component {
87
88
position : 'absolute' ,
88
89
right : '10px' ,
89
90
} }
91
+ data-testid = "closeSidebar"
90
92
>
91
93
< Close data-name = "svg" />
92
94
</ button >
You can’t perform that action at this time.
0 commit comments