You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
svelte/test/runtime/samples/store-auto-subscribe-in-each/_config.js

40 lines
706 B

import { writable } from '../../../../store.js';
export default {
skip: true,
props: {
things: [
writable('a'),
writable('b'),
writable('c')
]
},
html: `
<button>a</button>
<button>b</button>
<button>c</button>
`,
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, `
<button>a</button>
<button>B</button>
<button>c</button>
`);
await component.things[1].set('d');
assert.htmlEqual(target.innerHTML, `
<button>d</button>
<button>B</button>
<button>c</button>
`);
}
};