Fix Switch node handling of hasKey rule when property is undefined

This commit is contained in:
Nick O'Leary
2021-03-30 21:37:39 +01:00
parent 393290df2c
commit 8da00c0872
2 changed files with 7 additions and 2 deletions

View File

@@ -267,7 +267,12 @@ describe('switch Node', function() {
it('should not match if the key is not a string', function(done) {
genericSwitchTest("hask", 1, true, false, {a:1}, done);
});
it('should not match if the parent object does not exist - null', function(done) {
genericSwitchTest("hask", "a", true, false, null, done);
});
it('should not match if the parent object does not exist - undefined', function(done) {
genericSwitchTest("hask", "a", true, false, undefined, done);
});
it('should check if payload is between given values', function(done) {
twoFieldSwitchTest("btwn", "3", "5", true, true, 4, done);
});