Skip to content
This repository was archived by the owner on Jan 9, 2025. It is now read-only.

Commit 0370a67

Browse files
committed
test(unsafe-html): test for attributepart use case
1 parent 2399273 commit 0370a67

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

test/unsafe-html.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ describe('unsafeHTML', () => {
66
render(html`<div>${unsafeHTML('Hello World')}</div>`, surface)
77
expect(surface.innerHTML).to.equal('<div>Hello World</div>')
88
})
9+
it('disallows use inside of an attribute', () => {
10+
const surface = document.createElement('section')
11+
render(html`<div style="${unsafeHTML('Hello World')}"></div>`, surface)
12+
expect(surface.innerHTML).to.equal('<div style=""></div>')
13+
})
914
it('renders the given value as HTML', async () => {
1015
const surface = document.createElement('section')
1116
render(html`<div>${unsafeHTML('<span>Hello World</span>')}</div>`, surface)

0 commit comments

Comments
 (0)