mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Allow a node to declare settings that should be exported
This commit is contained in:
@@ -29,7 +29,7 @@ describe("api index", function() {
|
||||
describe("disables editor", function() {
|
||||
before(function() {
|
||||
api.init({},{
|
||||
settings:{httpNodeRoot:true, httpAdminRoot: true,disableEditor:true},
|
||||
settings:{httpNodeRoot:true, httpAdminRoot: true,disableEditor:true, exportNodeSettings: function() {}},
|
||||
events: {on:function(){},removeListener: function(){}},
|
||||
log: {info:function(){},_:function(){}},
|
||||
nodes: {paletteEditorEnabled: function(){return true}}
|
||||
|
@@ -42,7 +42,10 @@ describe("info api", function() {
|
||||
foo: 123,
|
||||
httpNodeRoot: "testHttpNodeRoot",
|
||||
version: "testVersion",
|
||||
paletteCategories :["red","blue","green"]
|
||||
paletteCategories :["red","blue","green"],
|
||||
exportNodeSettings: function(obj) {
|
||||
obj.testNodeSetting = "helloWorld";
|
||||
}
|
||||
},
|
||||
nodes: {
|
||||
paletteEditorEnabled: function() { return true; }
|
||||
@@ -59,7 +62,9 @@ describe("info api", function() {
|
||||
res.body.should.have.property("version","testVersion");
|
||||
res.body.should.have.property("paletteCategories",["red","blue","green"]);
|
||||
res.body.should.have.property("editorTheme",{test:456});
|
||||
res.body.should.have.property("testNodeSetting","helloWorld");
|
||||
res.body.should.not.have.property("foo",123);
|
||||
|
||||
done();
|
||||
});
|
||||
});
|
||||
@@ -68,8 +73,8 @@ describe("info api", function() {
|
||||
settings: {
|
||||
httpNodeRoot: "testHttpNodeRoot",
|
||||
version: "testVersion",
|
||||
paletteCategories :["red","blue","green"]
|
||||
|
||||
paletteCategories :["red","blue","green"],
|
||||
exportNodeSettings: function() {}
|
||||
},
|
||||
nodes: {
|
||||
paletteEditorEnabled: function() { return false; }
|
||||
|
Reference in New Issue
Block a user