« get me outta code hell

html: drastically simplify template/slot system - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/test/unit/util
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-04-08 16:54:39 -0300
committer(quasar) nebula <qznebula@protonmail.com>2023-04-08 16:54:39 -0300
commit776abf8d697716902692f357c6f179c1e681369f (patch)
treea75e7f63ffc13121c3c08f1f78c10bc883b4d4e1 /test/unit/util
parent0cbfa8c1b70080c7ec4eb352902cf76f8ef30fcf (diff)
html: drastically simplify template/slot system
Diffstat (limited to 'test/unit/util')
-rw-r--r--test/unit/util/html.js17
1 files changed, 5 insertions, 12 deletions
diff --git a/test/unit/util/html.js b/test/unit/util/html.js
index 9925d2da..045dad91 100644
--- a/test/unit/util/html.js
+++ b/test/unit/util/html.js
@@ -1,10 +1,10 @@
 import t from 'tap';
 
 import * as html from '../../../src/util/html.js';
-const {Tag, Attributes, Template, Slot} = html;
+const {Tag, Attributes, Template} = html;
 
 t.test(`html.tag`, t => {
-  t.plan(16);
+  t.plan(14);
 
   const tag1 =
     html.tag('div',
@@ -26,10 +26,8 @@ t.test(`html.tag`, t => {
   t.equal(tag2.content[1], 'children');
 
   const genericTag = html.tag('div');
-  let genericSlot;
-  const genericTemplate = html.template(slot => {
-    genericSlot = slot('title');
-    return html.blank();
+  const genericTemplate = html.template({
+    content: () => html.blank(),
   });
 
   // 9-10: tag treated as content, not attributes
@@ -42,12 +40,7 @@ t.test(`html.tag`, t => {
   t.equal(tag4.content.length, 1);
   t.equal(tag4.content[0], genericTemplate);
 
-  // 13-14: slot treated as content, not attributes
-  const tag5 = html.tag('div', genericSlot);
-  t.equal(tag5.content.length, 1);
-  t.equal(tag5.content[0], genericSlot);
-
-  // 15-16: deep flattening support
+  // 13-14: deep flattening support
   const tag6 =
     html.tag('div', [
       true &&