Add testing for HtmlElementCreator and fix ...args calls

All args passthrough class where missing the leading "..."

Added Testing to HtmlElementCreator
This commit is contained in:
2025-03-10 17:02:17 +09:00
parent 31d71afe47
commit 2f9333da54
5 changed files with 687 additions and 8 deletions

View File

@@ -26,7 +26,8 @@ class HtmlElementCreator {
return {
tag: tag,
id: id,
name: options.name, // override name if set [name gets ignored in tree build anyway]
// override name if set, else id is used. Only for input/button
name: options.name,
content: content,
css: css,
options: options,
@@ -46,7 +47,6 @@ class HtmlElementCreator {
if (id) {
// base id match already
if (base.id == id) {
// base.sub.push(Object.assign({}, attach));
base.sub.push(deepCopyFunction(attach));
} else {
// sub check
@@ -58,7 +58,6 @@ class HtmlElementCreator {
}
}
} else {
// base.sub.push(Object.assign({}, attach));
base.sub.push(deepCopyFunction(attach));
}
return base;
@@ -74,7 +73,6 @@ class HtmlElementCreator {
aelx(base, ...attach)
{
for (var i = 0; i < attach.length; i ++) {
// base.sub.push(Object.assign({}, attach[i]));
base.sub.push(deepCopyFunction(attach[i]));
}
return base;
@@ -90,7 +88,6 @@ class HtmlElementCreator {
aelxar(base, attach)
{
for (var i = 0; i < attach.length; i ++) {
// base.sub.push(Object.assign({}, attach[i]));
base.sub.push(deepCopyFunction(attach[i]));
}
return base;
@@ -149,6 +146,7 @@ class HtmlElementCreator {
{
this.rcssel(_element, rcss);
this.acssel(_element, acss);
return _element;
}
/**