1
0
Fork 0

FieldVisibilityEventHandler: Use new DataValidator API

master
Mike Gerwitz 2017-02-10 13:30:53 -05:00
commit 530b92fd33
2 changed files with 5 additions and 4 deletions

View File

@ -103,7 +103,7 @@ module.exports = Class( 'FieldVisibilityEventHandler' )
}
} )();
this._data_validator.clearFailures( [ field_name ] );
this._data_validator.clearFailures( { [field_name]: indexes } );
indexes.forEach( field_i => action( field_name, field_i ) );
callback();

View File

@ -96,11 +96,12 @@ describe( 'FieldVisibilityEventHandler', () =>
it( 'clears failures on hidden fields', done =>
{
const name = 'foo_bar';
const name = 'foo_bar';
const fail_indexes = [ 0, 3 ];
const hide_data = {
elementName: name,
indexes: [ 0 ],
indexes: fail_indexes,
};
Sut(
@ -108,7 +109,7 @@ describe( 'FieldVisibilityEventHandler', () =>
createStubDataProvider( failures =>
{
expect( failures )
.to.deep.equal( [ name ] )
.to.deep.equal( { [name]: fail_indexes } );
// we don't care about the rest of the processing at this
// point