mirror of https://github.com/sveltejs/svelte
parent
bd0157a4de
commit
c69c5d7c25
@ -1,6 +1,15 @@
|
||||
import { flushSync } from 'svelte';
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({
|
||||
ssrHtml: `<div></div>`,
|
||||
html: `<div>set from component</div>`
|
||||
html: `<button>update</button><div></div>`,
|
||||
|
||||
test({ target, assert, logs }) {
|
||||
const button = target.querySelector('button');
|
||||
|
||||
assert.deepEqual(logs, ['one DIV']);
|
||||
|
||||
flushSync(() => button?.click());
|
||||
assert.deepEqual(logs, ['one DIV', 'cleanup one', 'two DIV']);
|
||||
}
|
||||
});
|
||||
|
||||
Loading…
Reference in new issue