Mike Gerwitz

Activist for User Freedom

aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMike Gerwitz <gerwitzm@lovullo.com>2017-02-09 15:20:23 -0500
committerMike Gerwitz <gerwitzm@lovullo.com>2017-02-09 15:20:23 -0500
commitcc79f8e1f337276b5ec638c5136a847315fed0e8 (patch)
tree6dc84d320323b67381e1a6a390a6ee8187e79477 /test
parent3ea4efb73295a9fba21fc837dcbd7b1537616986 (diff)
downloadliza-cc79f8e1f337276b5ec638c5136a847315fed0e8.tar.gz
liza-cc79f8e1f337276b5ec638c5136a847315fed0e8.tar.bz2
liza-cc79f8e1f337276b5ec638c5136a847315fed0e8.zip
FieldVisibilityEventHandler: use new DataValidator API
I updated DataValidator but never updated the caller. Damnit. It's an unfortunate side-effect of dynamic, loosely typed languages and mitigating it requires what should be boilerplate functional tests (in this case---functional tests are useful for many other integration aspects). * src/event/FieldVisibilityEventHandler.js (handle): Use updated DataValidator#clearFailures API, which has a different descriptor format. * test/event/FieldVisibilityEventHandlerTest.js: Update test.
Diffstat (limited to 'test')
-rw-r--r--test/event/FieldVisibilityEventHandlerTest.js7
1 files changed, 4 insertions, 3 deletions
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