mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Update all node icons to SVG
When listing icons provided by a module, if there is a png and svg with the same name, only the svg will be listed. If a node asks for a png icon which is not known, but there is a corresponding svg, that will be used instead.
This commit is contained in:
@@ -33,7 +33,7 @@ describe("api/editor/ui", function() {
|
||||
nodes: {
|
||||
getIcon: function(opts) {
|
||||
return new Promise(function(resolve,reject) {
|
||||
fs.readFile(NR_TEST_UTILS.resolve("@node-red/editor-client/src/images/icons/arrow-in.png"), function(err,data) {
|
||||
fs.readFile(NR_TEST_UTILS.resolve("@node-red/editor-client/src/images/icons/arrow-in.svg"), function(err,data) {
|
||||
resolve(data);
|
||||
})
|
||||
});
|
||||
@@ -94,7 +94,7 @@ describe("api/editor/ui", function() {
|
||||
}
|
||||
}
|
||||
it('returns the requested icon', function(done) {
|
||||
var defaultIcon = fs.readFileSync(NR_TEST_UTILS.resolve("@node-red/editor-client/src/images/icons/arrow-in.png"));
|
||||
var defaultIcon = fs.readFileSync(NR_TEST_UTILS.resolve("@node-red/editor-client/src/images/icons/arrow-in.svg"));
|
||||
request(app)
|
||||
.get("/icons/module/icon.png")
|
||||
.expect("Content-Type", /image\/png/)
|
||||
|
@@ -192,7 +192,7 @@ describe("red/nodes/registry/localfilesystem",function() {
|
||||
list["node-red"].icons[0].should.have.property("path",path.join(__dirname,"resources/local/NestedDirectoryNode/NestedNode/icons"))
|
||||
list["node-red"].icons[0].should.have.property("icons");
|
||||
list["node-red"].icons[0].icons.should.have.length(1);
|
||||
list["node-red"].icons[0].icons[0].should.eql("arrow-in.png");
|
||||
list["node-red"].icons[0].icons[0].should.eql("arrow-in.svg");
|
||||
done();
|
||||
});
|
||||
it("scans icons dir in library",function(done) {
|
||||
@@ -297,7 +297,7 @@ describe("red/nodes/registry/localfilesystem",function() {
|
||||
nodeModule.TestNodeModule.icons.should.have.length(1);
|
||||
nodeModule.TestNodeModule.icons[0].should.have.property("path");
|
||||
nodeModule.TestNodeModule.icons[0].should.have.property("icons");
|
||||
nodeModule.TestNodeModule.icons[0].icons[0].should.eql("arrow-in.png");
|
||||
nodeModule.TestNodeModule.icons[0].icons[0].should.eql("arrow-in.svg");
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user