From 776abf8d697716902692f357c6f179c1e681369f Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sat, 8 Apr 2023 16:54:39 -0300 Subject: html: drastically simplify template/slot system --- test/unit/util/html.js | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'test/unit') 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 && -- cgit 1.3.0-6-gf8a5