diff --git a/test/runtime/samples/store-auto-subscribe-in-each/_config.js b/test/runtime/samples/store-auto-subscribe-in-each/_config.js new file mode 100644 index 0000000000..969f9a9b74 --- /dev/null +++ b/test/runtime/samples/store-auto-subscribe-in-each/_config.js @@ -0,0 +1,40 @@ +import { writable } from '../../../../store.js'; + +export default { + skip: true, + + props: { + things: [ + writable('a'), + writable('b'), + writable('c') + ] + }, + + html: ` + + + + `, + + async test({ assert, component, target, window }) { + const buttons = target.querySelectorAll('button'); + const click = new window.MouseEvent('click'); + + await buttons[1].dispatchEvent(click); + + assert.htmlEqual(target.innerHTML, ` + + + + `); + + await component.things[1].set('d'); + + assert.htmlEqual(target.innerHTML, ` + + + + `); + } +}; \ No newline at end of file diff --git a/test/runtime/samples/store-auto-subscribe-in-each/main.html b/test/runtime/samples/store-auto-subscribe-in-each/main.html new file mode 100644 index 0000000000..baf120838c --- /dev/null +++ b/test/runtime/samples/store-auto-subscribe-in-each/main.html @@ -0,0 +1,7 @@ + + +{#each things as thing} + +{/each} \ No newline at end of file