@sitecore-feaas/clientside 0.1.46 → 0.1.47

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/dom/html.ts CHANGED
@@ -66,7 +66,7 @@ class HTMLNode {
66
66
  return serializeHTML(this.childNodes)
67
67
  }
68
68
  set innerHTML(html: string) {
69
- this.childNodes = parseHTML(html)
69
+ this.childNodes = parseHTML(String(html ?? ''))
70
70
  }
71
71
  get outerHTML() {
72
72
  return serializeHTML([this])
package/test/dom.test.ts CHANGED
@@ -91,6 +91,13 @@ describe('DOM Clientside', function () {
91
91
  '<div><img data-path-src="image" src="a.jpg" /></div>'
92
92
  )
93
93
  })
94
+ it('should render mapped attribute', function () {
95
+ assertRenderedHTML(
96
+ `<div><img data-path-src="image" /></div>`,
97
+ { image: null },
98
+ '<div><img data-path-src="image" /></div>'
99
+ )
100
+ })
94
101
  it('should not render missing attribute', function () {
95
102
  assertRenderedHTML(
96
103
  `<div><img data-path-src="context.z" /></div>`,
@@ -156,6 +163,11 @@ describe('DOM Clientside', function () {
156
163
  { missing: 'a.jpg' },
157
164
  '<div data-path-custom-attribute="test"></div>'
158
165
  )
166
+ assertRenderedHTML(
167
+ `<div data-path-custom-attribute="test"></div>`,
168
+ { test: null },
169
+ '<div data-path-custom-attribute="test"></div>'
170
+ )
159
171
  })
160
172
  it('should render content hub docs as html', function () {
161
173
  assertRenderedHTML(