From 0857f979fffa4b9c87955fe50fdbe617cc4fe06c Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Wed, 18 Jan 2017 13:14:12 +0000 Subject: [PATCH] Update ui_spec for icon module path --- test/red/api/ui_spec.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/red/api/ui_spec.js b/test/red/api/ui_spec.js index c7947796b..51da1389d 100644 --- a/test/red/api/ui_spec.js +++ b/test/red/api/ui_spec.js @@ -64,7 +64,7 @@ describe("ui api", function() { describe("icon handler", function() { before(function() { app = express(); - app.get("/icons/:icon",ui.icon); + app.get("/icons/:module/:icon",ui.icon); }); function binaryParser(res, callback) { @@ -87,7 +87,7 @@ describe("ui api", function() { it('returns the default icon when getting an unknown icon', function(done) { var defaultIcon = fs.readFileSync(path.resolve(__dirname+'/../../../public/icons/arrow-in.png')); request(app) - .get("/icons/youwonthaveme.png") + .get("/icons/random-module/youwonthaveme.png") .expect("Content-Type", /image\/png/) .expect(200) .parse(binaryParser) @@ -104,7 +104,7 @@ describe("ui api", function() { it('returns a known icon', function(done) { var injectIcon = fs.readFileSync(path.resolve(__dirname+'/../../../public/icons/inject.png')); request(app) - .get("/icons/inject.png") + .get("/icons/node-red/inject.png") .expect("Content-Type", /image\/png/) .expect(200) .parse(binaryParser) @@ -120,9 +120,9 @@ describe("ui api", function() { it('returns a registered icon' , function(done) { var testIcon = fs.readFileSync(path.resolve(__dirname+'/../../resources/icons/test_icon.png')); - events.emit("node-icon-dir", path.resolve(__dirname+'/../../resources/icons')); + events.emit("node-icon-dir",{name:"test-module", path: path.resolve(__dirname+'/../../resources/icons')}); request(app) - .get("/icons/test_icon.png") + .get("/icons/test-module/test_icon.png") .expect("Content-Type", /image\/png/) .expect(200) .parse(binaryParser)