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/await-then-blowback-reactive/_config.js

20 lines
495 B

export default {
async test({ assert, component, target }) {
assert.htmlEqual(target.innerHTML, 'Loading...');
await component.promise;
const span = target.querySelector('span');
assert.equal(span.textContent, 'a');
const select = target.querySelector('select');
const options = [...target.querySelectorAll('option')];
const change = new window.Event('change');
options[1].selected = true;
await select.dispatchEvent(change);
assert.equal(span.textContent, 'b');
}
};