mirror of
				https://github.com/node-red/node-red.git
				synced 2025-03-01 10:36:34 +00:00 
			
		
		
		
	Remove event passing for icons/examples from the api layer
This commit is contained in:
		| @@ -17,6 +17,7 @@ | ||||
| var should = require("should"); | ||||
| var when = require("when"); | ||||
| var sinon = require("sinon"); | ||||
| var path = require("path"); | ||||
|  | ||||
| var typeRegistry = require("../../../../../red/runtime/nodes/registry/registry"); | ||||
|  | ||||
| @@ -483,4 +484,19 @@ describe("red/nodes/registry/registry",function() { | ||||
|         }); | ||||
|     }); | ||||
|  | ||||
|     describe('#getNodeIconPath', function() { | ||||
|         it('returns the default icon when getting an unknown icon', function() { | ||||
|             var defaultIcon = path.resolve(__dirname+'/../../../../../public/icons/arrow-in.png'); | ||||
|             var iconPath = typeRegistry.getNodeIconPath('random-module','youwonthaveme.png'); | ||||
|             iconPath.should.eql(defaultIcon); | ||||
|         }); | ||||
|  | ||||
|         it('returns a registered icon' , function() { | ||||
|             var testIcon = path.resolve(__dirname+'/../../../../resources/icons/test_icon.png'); | ||||
|             events.emit("node-icon-dir",{name:"test-module", path: path.resolve(__dirname+'/../../../../resources/icons')}); | ||||
|             var iconPath = typeRegistry.getNodeIconPath('test-module','test_icon.png'); | ||||
|             iconPath.should.eql(testIcon); | ||||
|         }); | ||||
|     }); | ||||
|  | ||||
| }); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user