@@ -81,10 +81,10 @@ describe('ui', () => {
8181 dataScenarioConfig . scenarios . forEach ( scenario => expect ( helper ) . to . equal ( scenario . test . config [ helperName ] ) )
8282 } )
8383
84- it ( "should shows object's toString() method in each scenario's name if the toString() method is overridden " , ( ) => {
85- const data = [ { toString : ( ) => 'test case title' } ]
84+ it ( "should use JSON in each scenario's name if the object overrides toString()" , ( ) => {
85+ const data = [ { name : 'John Do' , toString : ( ) => 'test case title' } ]
8686 const dataScenarioConfig = context . Data ( data ) . Scenario ( 'scenario' , ( ) => { } )
87- expect ( 'scenario | test case title ' ) . to . equal ( dataScenarioConfig . scenarios [ 0 ] . test . title )
87+ expect ( 'scenario | {"name":"John Do"} ' ) . to . equal ( dataScenarioConfig . scenarios [ 0 ] . test . title )
8888 } )
8989
9090 it ( "should shows JSON.stringify() in each scenario's name if the toString() method isn't overridden" , ( ) => {
@@ -128,5 +128,11 @@ describe('ui', () => {
128128 const dataScenarioConfig = context . Data ( [ new Secret ( 'theSecretPassword' ) ] ) . Scenario ( 'scenario' , ( ) => { } )
129129 expect ( dataScenarioConfig . scenarios [ 0 ] . test . title ) . to . equal ( 'scenario | *****' )
130130 } )
131+
132+ it ( "should not leak a skipped secret object's value into the title" , ( ) => {
133+ const data = Secret . secret ( { username : 'jon' , password : 'theSecretPassword' } , 'password' )
134+ context . xData ( [ data ] ) . Scenario ( 'scenario' )
135+ expect ( suite . tests . at ( - 1 ) . title ) . to . equal ( 'scenario | {"username":"jon","password":"*****"}' )
136+ } )
131137 } )
132138} )
0 commit comments