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/dynamic-component-dirty/_config.js

25 lines
461 B

const calls = [];
export default {
get props() {
return { calls };
},
before_test() {
calls.length = 0;
},
async test({ assert, component, target, window }) {
const buttons = target.querySelector('button');
assert.deepEqual(calls.length, 1);
const event = new window.MouseEvent('click');
await buttons.dispatchEvent(event);
assert.deepEqual(calls.length, 1);
component.current_path = 'bar';
assert.deepEqual(calls.length, 2);
}
};