Add initial support for ThemePlugins

This commit is contained in:
Nick O'Leary
2021-01-26 13:35:40 +00:00
parent 8e7a230dbc
commit 1f6328bf4e
9 changed files with 127 additions and 20 deletions

View File

@@ -33,11 +33,11 @@ describe("api/editor/theme", function () {
theme.init({settings: {}});
fs.statSync.restore();
});
it("applies the default theme", function () {
it("applies the default theme", async function () {
var result = theme.init({});
should.not.exist(result);
var context = theme.context();
var context = await theme.context();
context.should.have.a.property("page");
context.page.should.have.a.property("title", "Node-RED");
context.page.should.have.a.property("favicon", "favicon.ico");
@@ -52,7 +52,7 @@ describe("api/editor/theme", function () {
should.not.exist(theme.settings());
});
it("picks up custom theme", function () {
it("picks up custom theme", async function () {
theme.init({
editorTheme: {
page: {
@@ -104,7 +104,7 @@ describe("api/editor/theme", function () {
theme.app();
var context = theme.context();
var context = await theme.context();
context.should.have.a.property("page");
context.page.should.have.a.property("title", "Test Page Title");
context.page.should.have.a.property("favicon", "theme/favicon/favicon");