@@ -34,7 +34,7 @@ const parsesAsInteger = str => {
34
34
}
35
35
const isInteger = str => typeof str === 'number' || parsesAsInteger ( str )
36
36
37
- const openTableExpectCountOf = function ( ctx , expectedCount , expectedErrorRate , cmd ) {
37
+ const _openTableExpectCountOf = function ( ctx , expectedCount , expectedErrorRate , cmd ) {
38
38
const view = `${ ui . selectors . SIDECAR_CUSTOM_CONTENT } .activation-viz-plugin` ,
39
39
row = `${ view } tr[data-action-name="${ actionName } "]` ,
40
40
successCell = `${ row } .cell-successes.cell-hide-when-outliers-shown` ,
@@ -79,7 +79,12 @@ const openTableExpectCountOf = function(ctx, expectedCount, expectedErrorRate, c
79
79
}
80
80
} ) ;
81
81
82
- it ( `open activation table, with ${ cmd } ` , ( ) => new Promise ( ( resolve , reject ) => once ( 0 , resolve , reject ) ) )
82
+ return new Promise ( ( resolve , reject ) => once ( 0 , resolve , reject ) )
83
+ }
84
+ const openTableExpectCountOf = function ( ) {
85
+ const cmd = arguments [ arguments . length - 1 ]
86
+
87
+ it ( `open activation table, with ${ cmd } ` , ( ) => _openTableExpectCountOf . apply ( this , arguments ) )
83
88
}
84
89
exports . openTableExpectCountOf = openTableExpectCountOf
85
90
@@ -150,6 +155,15 @@ describe('Activation table visualization', function() {
150
155
openTableExpectCountOf ( this , 3 , 1 , 'summary' )
151
156
openTableExpectCountOf ( this , 3 , 1 , 'summary --batches 10' )
152
157
158
+ it ( 'should open table, click on a failure cell, and show grid' , ( ) => _openTableExpectCountOf ( this , 3 , 1 , 'summary --batches 10' )
159
+ . then ( ( ) => `${ ui . selectors . SIDECAR_CUSTOM_CONTENT } tr[data-action-name="${ actionName } "] .cell-errors` )
160
+ . then ( selector => this . app . client . scroll ( selector )
161
+ . then ( this . app . client . click ( selector ) ) )
162
+ . then ( ( ) => this . app )
163
+ . then ( sidecar . expectOpen )
164
+ . then ( sidecar . expectMode ( 'grid' ) )
165
+ . catch ( common . oops ( this ) ) )
166
+
153
167
// force a version update
154
168
it ( 'should create the action that bombs if the input value is negative' , ( ) => cli . do ( `let ${ actionName } = ({x}) => x<0 ? {error:'bomb!'} : {x: x}` , this . app )
155
169
. then ( cli . expectOK )
0 commit comments