mirror of https://github.com/sveltejs/svelte
parent
17e6c4f834
commit
5768df1300
@ -0,0 +1,5 @@
|
||||
---
|
||||
'svelte': patch
|
||||
---
|
||||
|
||||
chore: remove selector api
|
@ -1,47 +0,0 @@
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({
|
||||
html: `
|
||||
<button>false</button>
|
||||
<button>false</button>
|
||||
<button>false</button>
|
||||
<p></p>
|
||||
`,
|
||||
|
||||
async test({ assert, target }) {
|
||||
const [b1, b2, b3] = target.querySelectorAll('button');
|
||||
|
||||
await b1.click();
|
||||
assert.htmlEqual(
|
||||
target.innerHTML,
|
||||
`
|
||||
<button>true</button>
|
||||
<button>false</button>
|
||||
<button>false</button>
|
||||
<p>1</p>
|
||||
`
|
||||
);
|
||||
|
||||
await b3.click();
|
||||
assert.htmlEqual(
|
||||
target.innerHTML,
|
||||
`
|
||||
<button>false</button>
|
||||
<button>false</button>
|
||||
<button>true</button>
|
||||
<p>3</p>
|
||||
`
|
||||
);
|
||||
|
||||
await b2.click();
|
||||
assert.htmlEqual(
|
||||
target.innerHTML,
|
||||
`
|
||||
<button>false</button>
|
||||
<button>true</button>
|
||||
<button>false</button>
|
||||
<p>2</p>
|
||||
`
|
||||
);
|
||||
}
|
||||
});
|
@ -1,11 +0,0 @@
|
||||
<script>
|
||||
import { selector } from 'svelte';
|
||||
let array = $state([1, 2, 3]);
|
||||
let selected = selector();
|
||||
</script>
|
||||
|
||||
{#each array as item}
|
||||
<button on:click={() => selected.set(item)}>{selected.is(item)}</button>
|
||||
{/each}
|
||||
|
||||
<p>{selected.current}</p>
|
Loading…
Reference in new issue