@@ -34,7 +34,7 @@ const parsesAsInteger = str => {
3434}
3535const isInteger = str => typeof str === 'number' || parsesAsInteger ( str )
3636
37- const openTableExpectCountOf = function ( ctx , expectedCount , expectedErrorRate , cmd ) {
37+ const _openTableExpectCountOf = function ( ctx , expectedCount , expectedErrorRate , cmd ) {
3838 const view = `${ ui . selectors . SIDECAR_CUSTOM_CONTENT } .activation-viz-plugin` ,
3939 row = `${ view } tr[data-action-name="${ actionName } "]` ,
4040 successCell = `${ row } .cell-successes.cell-hide-when-outliers-shown` ,
@@ -79,7 +79,12 @@ const openTableExpectCountOf = function(ctx, expectedCount, expectedErrorRate, c
7979 }
8080 } ) ;
8181
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 ) )
8388}
8489exports . openTableExpectCountOf = openTableExpectCountOf
8590
@@ -150,6 +155,15 @@ describe('Activation table visualization', function() {
150155 openTableExpectCountOf ( this , 3 , 1 , 'summary' )
151156 openTableExpectCountOf ( this , 3 , 1 , 'summary --batches 10' )
152157
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+
153167 // force a version update
154168 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 )
155169 . then ( cli . expectOK )
0 commit comments