From 3b59a62957a96ea2c5bbde1adbf583885047fd24 Mon Sep 17 00:00:00 2001 From: Nolan Lawson Date: Thu, 21 Mar 2024 18:38:00 -0700 Subject: [PATCH] test: add test --- test/spec/picker/framework.test.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/test/spec/picker/framework.test.js b/test/spec/picker/framework.test.js index 2fedb7a..c644672 100644 --- a/test/spec/picker/framework.test.js +++ b/test/spec/picker/framework.test.js @@ -58,6 +58,24 @@ describe('framework', () => { expect(node.outerHTML).toBe('
foo
') }) + test('dynamic expression with whitespace around it - minifier should be working', () => { + const state = { name: 'foo' } + + const { html } = createFramework(state) + + let node + const render = () => { + node = html`
${state.name}\t\n
` + } + + render() + expect(node.outerHTML).toBe('
foo
') + + state.name = 'baz' + render() + expect(node.outerHTML).toBe('
baz
') + }) + // Framework no longer supports this since we switched from HTML comments to text nodes test.skip('render two dynamic expressions inside the same element', () => { const state = { name1: 'foo', name2: 'bar' }