mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Add support for env var propety in switch node
This commit is contained in:
parent
2cc19e7e32
commit
f8dd68ecc4
@ -128,7 +128,7 @@
|
||||
var node = this;
|
||||
var previousValueType = {value:"prev",label:this._("inject.previous"),hasValue:false};
|
||||
|
||||
$("#node-input-property").typedInput({default:this.propertyType||'msg',types:['msg','flow','global','jsonata']});
|
||||
$("#node-input-property").typedInput({default:this.propertyType||'msg',types:['msg','flow','global','jsonata','env']});
|
||||
var outputCount = $("#node-input-outputs").val("{}");
|
||||
|
||||
var andLabel = this._("switch.and");
|
||||
|
@ -818,6 +818,14 @@ describe('switch Node', function() {
|
||||
});
|
||||
});
|
||||
|
||||
it('should handle env var expression', function(done) {
|
||||
var flow = [{id:"switchNode1",type:"switch",name:"switchNode",property:"VAR",propertyType:"env",rules:[{"t":"eq","v":"VAL"}],checkall:true,outputs:1,wires:[["helperNode1"]]},
|
||||
{id:"helperNode1", type:"helper", wires:[]}];
|
||||
process.env.VAR = "VAL";
|
||||
customFlowSwitchTest(flow, true, "OK", done);
|
||||
});
|
||||
|
||||
|
||||
it('should take head of message sequence (no repair)', function(done) {
|
||||
var flow = [{id:"switchNode1",type:"switch",name:"switchNode",property:"payload",rules:[{"t":"head","v":3}],checkall:false,repair:false,outputs:1,wires:[["helperNode1"]]},
|
||||
{id:"helperNode1", type:"helper", wires:[]}];
|
||||
|
Loading…
Reference in New Issue
Block a user