mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Resync with master
This commit is contained in:
@@ -166,6 +166,18 @@ describe('template node', function() {
|
||||
});
|
||||
});
|
||||
|
||||
it('should handle block contexts objects', function(done) {
|
||||
var flow = [{id:"n1", type:"template", template: "A{{#payload.A}}{{payload.A}}{{.}}{{/payload.A}}B",wires:[["n2"]]},{id:"n2",type:"helper"}];
|
||||
helper.load(templateNode, flow, function() {
|
||||
var n1 = helper.getNode("n1");
|
||||
var n2 = helper.getNode("n2");
|
||||
n2.on("input", function(msg) {
|
||||
msg.should.have.property('payload','AabcabcB');
|
||||
done();
|
||||
});
|
||||
n1.receive({payload:{A:"abc"}});
|
||||
});
|
||||
});
|
||||
it('should raise error if passed bad template', function(done) {
|
||||
var flow = [{id:"n1", type:"template", field: "payload", template: "payload={{payload",wires:[["n2"]]},{id:"n2",type:"helper"}];
|
||||
helper.load(templateNode, flow, function() {
|
||||
|
Reference in New Issue
Block a user