mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Updated the logic to be easier to follow
This commit is contained in:
@@ -280,26 +280,4 @@ describe('Unit: PayloadValidator', () => {
|
||||
assert.strictEqual(result.should.set.hello, value);
|
||||
});
|
||||
});
|
||||
|
||||
describe('Can set', () => {
|
||||
let payloadValidator;
|
||||
before(() => {
|
||||
const event = orgEvent('event');
|
||||
payloadValidator = new PayloadValidator(event, 'before-worker-id-nodeId');
|
||||
});
|
||||
|
||||
it('Should get back false for canSet when object is a string', () => {
|
||||
const object = 'some string';
|
||||
const location = 'hello';
|
||||
const result = payloadValidator.canSet(object, location);
|
||||
assert.strictEqual(result, false);
|
||||
});
|
||||
|
||||
it('Should get back true for canSet', () => {
|
||||
const object = {};
|
||||
const location = 'should.set.hello';
|
||||
const result = payloadValidator.canSet(object, location);
|
||||
assert.strictEqual(result, true);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user