@@ -105,8 +105,26 @@ const TASK = {
105
105
}
106
106
] ,
107
107
runtime : {
108
- completion : '(succeeded and x) or failed'
109
- }
108
+ completion : '(succeeded and x) or failed' ,
109
+ runMode : 'Live' ,
110
+ } ,
111
+ xtriggers : [
112
+ {
113
+ label : 'xtrigger' ,
114
+ id : 'my-xtrigger(foo=99)' ,
115
+ satisfied : false
116
+ } ,
117
+ {
118
+ label : 'xtrigger' ,
119
+ id : 'my-xtrigger(foo=42)' ,
120
+ satisfied : false
121
+ } ,
122
+ {
123
+ label : 'wallclock-xtrigger' ,
124
+ id : 'wall_clock(trigger_time=634737600)' ,
125
+ satisfied : true
126
+ }
127
+ ]
110
128
} ,
111
129
children : [
112
130
{
@@ -135,7 +153,7 @@ describe('Info component', () => {
135
153
task : TASK ,
136
154
class : 'job_theme--default' ,
137
155
// NOTE: expand all sections by default
138
- panelExpansion : [ 0 , 1 , 2 , 3 ] ,
156
+ panelExpansion : [ 0 , 1 , 2 , 3 , 4 , 5 ] ,
139
157
}
140
158
} )
141
159
@@ -156,6 +174,21 @@ describe('Info component', () => {
156
174
. should ( 'have.attr' , 'href' , 'https://cylc.org' )
157
175
. contains ( / ^ h t t p s : \/ \/ c y l c .o r g $ / )
158
176
177
+ // the run mode panel:
178
+ cy . get ( '.run-mode-panel.v-expansion-panel--active' ) . should ( 'be.visible' )
179
+ . contains ( 'Live' )
180
+
181
+ // the xtriggers panel
182
+ cy . get ( '.xtriggers-panel.v-expansion-panel--active' ) . should ( 'be.visible' )
183
+ . get ( 'table' )
184
+ . get ( 'tbody tr' )
185
+ . children ( )
186
+ . then ( ( selector ) => {
187
+ expect ( selector [ 0 ] . innerText ) . to . equal ( 'wallclock-xtrigger' )
188
+ expect ( selector [ 4 ] . innerText ) . to . equal ( 'my-xtrigger(foo=42)' )
189
+ expect ( selector [ 7 ] . innerText ) . to . equal ( 'my-xtrigger(foo=99)' )
190
+ } )
191
+
159
192
// the prerequisites panel
160
193
cy . get ( '.prerequisites-panel.v-expansion-panel--active' ) . should ( 'be.visible' )
161
194
. find ( '.prerequisite-alias.condition' )
@@ -246,7 +279,7 @@ describe('Info component', () => {
246
279
. get ( '@wrapper' ) . then ( ( { wrapper } ) => {
247
280
expect (
248
281
wrapper . emitted ( 'update:panelExpansion' ) [ 0 ] [ 0 ]
249
- ) . to . deep . equal ( [ 0 , 1 ] )
282
+ ) . to . deep . equal ( [ 0 , 3 ] )
250
283
} )
251
284
} )
252
285
@@ -266,6 +299,8 @@ describe('Info component', () => {
266
299
} ,
267
300
prerequisites : [ ] ,
268
301
outputs : [ ] ,
302
+ runtime : { } ,
303
+ xtriggers : [ ]
269
304
} ,
270
305
children : [ ] ,
271
306
}
@@ -275,8 +310,45 @@ describe('Info component', () => {
275
310
task,
276
311
class : 'job_theme--default' ,
277
312
// NOTE: expand all sections by default
278
- panelExpansion : [ 0 , 1 , 2 ] ,
313
+ panelExpansion : [ 0 , 1 , 2 , 3 ] ,
279
314
}
280
315
} )
281
316
} )
317
+
318
+ for ( const mode of [ 'Skip' , 'Simulation' , 'Dummy' ] ) {
319
+ it ( 'should display ' + mode + ' mode' , ( ) => {
320
+ // ensure the component can be mounted without errors for empty states
321
+ // i.e. no metadata, prerequisites, outputs or jobs
322
+ const tokens = new Tokens ( '~user/workflow//1234/foo' )
323
+ const task = {
324
+ id : tokens . id ,
325
+ name : tokens . task ,
326
+ tokens,
327
+ node : {
328
+ task : {
329
+ meta : {
330
+ customMeta : { }
331
+ }
332
+ } ,
333
+ prerequisites : [ ] ,
334
+ outputs : [ ] ,
335
+ runtime : { runMode : mode } ,
336
+ xtriggers : [ ]
337
+ } ,
338
+ children : [ ] ,
339
+ }
340
+
341
+ cy . vmount ( InfoComponent , {
342
+ props : {
343
+ task,
344
+ class : 'job_theme--default' ,
345
+ // Expand just the run mode panel
346
+ panelExpansion : [ 1 ] ,
347
+ }
348
+ } )
349
+
350
+ cy . get ( '.run-mode-panel.v-expansion-panel--active' ) . should ( 'be.visible' )
351
+ . contains ( mode )
352
+ } )
353
+ }
282
354
} )
0 commit comments