1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

editorTheme not setting custom css/scripts properly

This commit is contained in:
Nick O'Leary 2017-07-04 09:33:00 +01:00
parent 347e598715
commit 70a22187f7
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9
2 changed files with 9 additions and 4 deletions

View File

@ -98,11 +98,11 @@ module.exports = {
if (theme.page) {
themeContext.page.css = serveFilesFromTheme(
themeContext.page.css,
theme.page.css,
themeApp,
"/css/")
themeContext.page.scripts = serveFilesFromTheme(
themeContext.page.scripts,
theme.page.scripts,
themeApp,
"/scripts/")

View File

@ -55,7 +55,7 @@ describe("theme handler", function() {
page: {
title: "Test Page Title",
favicon: "/absolute/path/to/theme/icon",
css: "/absolute/path/to/custom/css/file",
css: "/absolute/path/to/custom/css/file.css",
scripts: "/absolute/path/to/script.js"
},
header: {
@ -92,14 +92,19 @@ describe("theme handler", function() {
}});
theme.app();
var context = theme.context();
context.should.have.a.property("page");
context.page.should.have.a.property("title","Test Page Title");
context.should.have.a.property("header");
context.header.should.have.a.property("title","Test Header Title");
context.page.should.have.a.property("css");
context.page.css.should.have.lengthOf(1);
context.page.css[0].should.eql('theme/css/file.css');
context.page.should.have.a.property("scripts");
context.page.scripts.should.have.lengthOf(1);
context.page.scripts[0].should.eql('theme/scripts/script.js');
var settings = theme.settings();
settings.should.have.a.property("deployButton");