Mike Gerwitz

Activist for User Freedom

aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Gerwitz <gerwitzm@lovullo.com>2017-02-10 13:30:53 -0500
committerMike Gerwitz <gerwitzm@lovullo.com>2017-02-10 13:30:53 -0500
commit530b92fd335bec9767f3a6c182977a5d65f643c4 (patch)
tree6dc84d320323b67381e1a6a390a6ee8187e79477
parent3ea4efb73295a9fba21fc837dcbd7b1537616986 (diff)
parentcc79f8e1f337276b5ec638c5136a847315fed0e8 (diff)
downloadliza-530b92fd335bec9767f3a6c182977a5d65f643c4.tar.gz
liza-530b92fd335bec9767f3a6c182977a5d65f643c4.tar.bz2
liza-530b92fd335bec9767f3a6c182977a5d65f643c4.zip
FieldVisibilityEventHandler: Use new DataValidator API
-rw-r--r--src/event/FieldVisibilityEventHandler.js2
-rw-r--r--test/event/FieldVisibilityEventHandlerTest.js7
2 files changed, 5 insertions, 4 deletions
diff --git a/src/event/FieldVisibilityEventHandler.js b/src/event/FieldVisibilityEventHandler.js
index aa5b33d..99e51c8 100644
--- a/src/event/FieldVisibilityEventHandler.js
+++ b/src/event/FieldVisibilityEventHandler.js
@@ -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();
diff --git a/test/event/FieldVisibilityEventHandlerTest.js b/test/event/FieldVisibilityEventHandlerTest.js
index 005e0e7..85b07c9 100644
--- a/test/event/FieldVisibilityEventHandlerTest.js
+++ b/test/event/FieldVisibilityEventHandlerTest.js
@@ -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