@@ -45,14 +45,8 @@ describe('Edit Runtime form', () => {
45
45
* @param {string } nodeName - the tree node name, to search for and open the mutations form
46
46
*/
47
47
const openMenu = ( nodeName ) => {
48
- cy . get ( '[data-cy=tree-view]' ) . as ( 'treeView' )
49
- . find ( '.c-task' )
50
- . should ( 'be.visible' )
51
- cy . get ( '@treeView' )
52
- . find ( 'span' )
53
- . contains ( nodeName )
54
- . parent ( )
55
- . find ( '.c-task' )
48
+ cy . get ( `[data-node-name=${ nodeName } ]` )
49
+ . find ( '[data-c-interactive]:first' )
56
50
. click ( { force : true } )
57
51
cy . get ( '#less-more-button' )
58
52
. click ( )
@@ -65,6 +59,15 @@ describe('Edit Runtime form', () => {
65
59
. contains ( '.c-mutation' , 'Edit Runtime' )
66
60
}
67
61
62
+ /**
63
+ * Open the Edit Runtime form for a particular node
64
+ * @param {string } nodeName
65
+ */
66
+ const openForm = ( nodeName ) => {
67
+ openMenu ( nodeName )
68
+ getMenuItem ( ) . click ( )
69
+ }
70
+
68
71
/**
69
72
* Get the form input v-list-item element for a given label.
70
73
*
@@ -79,8 +82,7 @@ describe('Edit Runtime form', () => {
79
82
}
80
83
81
84
it ( 'handles editing and submitting the form' , ( ) => {
82
- openMenu ( 'retrying' )
83
- getMenuItem ( ) . click ( )
85
+ openForm ( 'retrying' )
84
86
85
87
getInputListItem ( 'Init Script' )
86
88
. find ( '.v-input' )
@@ -132,8 +134,7 @@ describe('Edit Runtime form', () => {
132
134
} )
133
135
134
136
it ( 'handles a form with zero diff' , ( ) => {
135
- openMenu ( 'retrying' )
136
- getMenuItem ( ) . click ( )
137
+ openForm ( 'retrying' )
137
138
138
139
getInputListItem ( 'Outputs' )
139
140
// Add an empty item
@@ -185,4 +186,19 @@ describe('Edit Runtime form', () => {
185
186
. should ( 'not.exist' ) // if this does deliberately exist in future, change to .click()
186
187
getMenuItem ( ) . should ( 'not.exist' )
187
188
} )
189
+
190
+ it ( 'only offers live & skip run modes' , ( ) => {
191
+ openForm ( 'retrying' )
192
+ getInputListItem ( 'Run Mode' )
193
+ . find ( '.v-field' )
194
+ . click ( )
195
+ . invoke ( 'attr' , 'aria-controls' ) . then ( ( dropdownID ) => {
196
+ cy . get ( `#${ dropdownID } ` )
197
+ . find ( '[role=option]' )
198
+ . then (
199
+ ( items ) => Array . from ( items , ( x ) => x . innerText ) . sort ( )
200
+ )
201
+ . should ( 'deep.equal' , [ 'Live' , 'Skip' ] )
202
+ } )
203
+ } )
188
204
} )
0 commit comments