diff --git a/test/runtime/samples/binding-contenteditable-innertext/_config.js b/test/runtime/samples/binding-contenteditable-innertext/_config.js
new file mode 100644
index 0000000000..4c30a3231a
--- /dev/null
+++ b/test/runtime/samples/binding-contenteditable-innertext/_config.js
@@ -0,0 +1,40 @@
+export default {
+ html: `
+
hello world
+ `, + + ssrHtml: ` +hello undefined
+ `, + + async test({ assert, component, target, window }) { + assert.equal(component.name, 'world'); + + const el = target.querySelector('editor'); + + el.innerHTML = 'everybody'; + + // No updates to data yet + assert.htmlEqual(target.innerHTML, ` +hello world
+ `); + + // Handle user input + const event = new window.Event('input'); + await el.dispatchEvent(event); + assert.htmlEqual(target.innerHTML, ` +hello everybody
+ `); + + component.name = 'goodbye'; + assert.equal(el.innerHTML, 'goodbye'); + assert.htmlEqual(target.innerHTML, ` +hello goodbye
+ `); + } +}; diff --git a/test/runtime/samples/binding-contenteditable-innertext/main.svelte b/test/runtime/samples/binding-contenteditable-innertext/main.svelte new file mode 100644 index 0000000000..4a65dba05f --- /dev/null +++ b/test/runtime/samples/binding-contenteditable-innertext/main.svelte @@ -0,0 +1,8 @@ + + +hello {@html name}
diff --git a/test/validator/samples/a11y-contenteditable-element-without-child/errors.json b/test/validator/samples/a11y-contenteditable-element-without-child/errors.json index dd2a915b9d..311f20e17d 100644 --- a/test/validator/samples/a11y-contenteditable-element-without-child/errors.json +++ b/test/validator/samples/a11y-contenteditable-element-without-child/errors.json @@ -1,7 +1,7 @@ [ { "code": "missing-contenteditable-attribute", - "message": "'contenteditable' attribute is required for textContent and innerHTML two-way bindings", + "message": "'contenteditable' attribute is required for textContent/innerHTML/innerText two-way bindings", "start": { "line": 6, "column": 3,