@@ -16,12 +16,12 @@ const props = {
16
16
let currentStepIndex = 5 ;
17
17
18
18
describe ( 'Before Tutorial is entered' , ( ) => {
19
- test ( 'How to use button exists' , ( ) => {
19
+ test ( 'Tutorial button exists' , ( ) => {
20
20
render ( < Tutorial { ...props } /> ) ;
21
21
expect ( screen . getByText ( 'Tutorial' ) ) . toBeInTheDocument ( ) ;
22
22
} ) ;
23
23
24
- test ( 'User clicking "How to use" while on map tab button starts map tutorial ' , ( ) => {
24
+ test ( 'User clicking tutorial button while on map tab starts map tutorial ' , ( ) => {
25
25
props . currentTabInApp = 'map' ;
26
26
27
27
render ( < Tutorial { ...props } /> ) ;
@@ -31,17 +31,31 @@ describe('Before Tutorial is entered', () => {
31
31
) . toBeInTheDocument ( ) ;
32
32
} ) ;
33
33
34
- test ( 'User clicking "How to use" while on performance tab button starts performance tutorial ' , ( ) => {
34
+ test ( 'User clicking tutorial button while on performance tab starts performance tutorial ' , ( ) => {
35
35
props . currentTabInApp = 'performance' ;
36
36
render ( < Tutorial { ...props } /> ) ;
37
37
fireEvent . click ( screen . getByRole ( 'button' ) ) ;
38
38
expect ( screen . getByText ( 'Performance Tab' ) ) . toBeInTheDocument ( ) ;
39
39
} ) ;
40
40
41
- test ( 'User clicking "How to use" while on performance comparison tab, no tutorial available ' , ( ) => {
42
- props . currentTabInApp = 'performance-comparison' ;
43
- currentStepIndex = 1 ;
41
+ test ( 'User clicking tutorial button while on history tab starts history tutorial ' , ( ) => {
42
+ props . currentTabInApp = 'history' ;
44
43
render ( < Tutorial { ...props } /> ) ;
45
44
fireEvent . click ( screen . getByRole ( 'button' ) ) ;
45
+ expect ( screen . getByText ( 'History Tab' ) ) . toBeInTheDocument ( ) ;
46
+ } ) ;
47
+
48
+ test ( 'User clicking tutorial button while on web metrics tab starts web metrics tutorial ' , ( ) => {
49
+ props . currentTabInApp = 'webmetrics' ;
50
+ render ( < Tutorial { ...props } /> ) ;
51
+ fireEvent . click ( screen . getByRole ( 'button' ) ) ;
52
+ expect ( screen . getByText ( 'Webmetrics Tab' ) ) . toBeInTheDocument ( ) ;
53
+ } ) ;
54
+
55
+ test ( 'User clicking tutorial button while on tree tab starts tree tutorial ' , ( ) => {
56
+ props . currentTabInApp = 'tree' ;
57
+ render ( < Tutorial { ...props } /> ) ;
58
+ fireEvent . click ( screen . getByRole ( 'button' ) ) ;
59
+ expect ( screen . getByText ( 'Tree Tab' ) ) . toBeInTheDocument ( ) ;
46
60
} ) ;
47
61
} ) ;
0 commit comments