Support descriptions in plugin embeds (fixes #224)
Change-Id: I65f15113c08d464d6eef2af1186e1ebfa7dab225
diff --git a/dev/js/spec/pluginSpec.js b/dev/js/spec/pluginSpec.js
index acadeac..6dd31b3 100644
--- a/dev/js/spec/pluginSpec.js
+++ b/dev/js/spec/pluginSpec.js
@@ -253,6 +253,7 @@
embed : [{
panel : 'result',
title : 'Glemm',
+ desc : 'Start Glemm',
onClick : {
state : 'check',
template : 'about:blank',
@@ -265,7 +266,8 @@
let b = p.actions().element().firstChild;
expect(b.hasAttribute("data-icon")).toBeFalsy();
expect(b.hasAttribute("cls")).toBeFalsy();
- expect(b.getAttribute("title")).toEqual("Glemm");
+ expect(b.lastChild.innerText).toEqual("Glemm");
+ expect(b.getAttribute("title")).toEqual("Start Glemm");
expect(b.firstChild.classList.contains('button-icon')).toBeTruthy();
expect(b.firstChild.classList.contains('check')).toBeTruthy();
expect(b.firstChild.classList.contains('checked')).toBeFalsy();
@@ -278,7 +280,7 @@
expect(manager.states().toString()).toEqual("\"check\":true");
- expect(b.getAttribute("title")).toEqual("Glemm");
+ expect(b.getAttribute("title")).toEqual("Start Glemm");
expect(b.firstChild.classList.contains('button-icon')).toBeTruthy();
expect(b.firstChild.classList.contains('check')).toBeTruthy();
expect(b.firstChild.classList.contains('checked')).toBeTruthy();
@@ -401,6 +403,7 @@
embed : [{
panel : 'result',
title : 'Add',
+ desc : 'Add something',
onClick : {
template : 'about:blank',
action : 'addWidget',
@@ -410,6 +413,8 @@
});
let b = p.actions().element().firstChild;
+ expect(b.lastChild.innerText).toEqual("Add");
+ expect(b.getAttribute("title")).toEqual("Add something");
b.click();
expect(p.element().querySelectorAll("iframe").length).toEqual(1);
expect(p.element().querySelector("iframe").getAttribute('sandbox')).toEqual('allow-forms allow-scripts');