18
18
import { WorkflowStateOrder } from '@/model/WorkflowState.model'
19
19
20
20
describe ( 'Dashboard' , ( ) => {
21
- it ( 'Displays the Dashboard link as active on the left sidebar menu' , ( ) => {
21
+ beforeEach ( ( ) => {
22
22
cy . visit ( '/#/' )
23
+ } )
24
+
25
+ it ( 'Displays the Dashboard link as active on the left sidebar menu' , ( ) => {
23
26
cy
24
27
. get ( 'div.v-list-item__title' )
25
28
. contains ( 'Dashboard' )
26
29
. parent ( )
27
30
. should ( 'have.class' , 'v-list-item--active' )
28
31
} )
29
- it ( 'Should display the icons' , ( ) => {
30
- cy . visit ( '/#/' )
32
+
33
+ it ( 'Displays the icons' , ( ) => {
31
34
cy
32
35
. get ( '.c-dashboard .v-icon:first' )
33
36
. find ( 'svg' )
34
37
. should ( 'be.visible' )
35
38
} )
36
- it ( 'Should display the states in order' , ( ) => {
37
- cy . visit ( '/#/' )
39
+
40
+ it ( 'Displays the states in order' , ( ) => {
38
41
cy
39
42
. get ( '#dashboard-workflows table tbody tr' )
40
43
. first ( )
@@ -44,11 +47,22 @@ describe('Dashboard', () => {
44
47
} )
45
48
. should ( 'equal' , [ ...WorkflowStateOrder . entries ( ) ] [ 0 ] [ 0 ] )
46
49
} )
47
- it ( 'Should have disabled cylc hub button in single user mode' , ( ) => {
48
- cy . visit ( '/#/' )
50
+
51
+ it ( 'Disables cylc hub button in single user mode' , ( ) => {
49
52
cy
50
53
. get ( '#cylc-hub-button' )
51
54
. should ( 'have.class' , 'v-list-item--disabled' )
52
55
} )
56
+
57
+ for ( const ref of [ 'workflow-table-link' , 'user-settings-link' , 'quickstart-link' ] ) {
58
+ it ( `Visits ${ ref } ` , ( ) => {
59
+ cy . get ( `[data-cy=${ ref } ` )
60
+ . click ( )
61
+ cy . contains ( 'Page not found' , { matchCase : false } )
62
+ . should ( 'not.exist' )
63
+ // Ideally we should check for HTTP 404 but our 404 page returns 200!
64
+ // https://github.com/cylc/cylc-ui/issues/334
65
+ } )
66
+ }
53
67
// TODO: add test that verifies the dashboard content after we have reviewed how it should look like
54
68
} )
0 commit comments