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/component-slot-let-inline-f.../_config.js

28 lines
556 B

let logs;
function log(value) {
logs.push(value);
}
export default {
html: '<button>click me</button>',
props: {
a: 'a',
b: 'b',
log
},
before_test() {
logs = [];
},
async test({ assert, component, target, window }) {
const button = target.querySelector('button');
await button.dispatchEvent(new window.MouseEvent('click'));
assert.deepEqual(logs, ['a: a, b: b']);
component.a = '1';
component.b = '2';
await button.dispatchEvent(new window.MouseEvent('click'));
assert.deepEqual(logs, ['a: a, b: b', 'a: 1, b: 2']);
}
};