mirror of https://github.com/sveltejs/svelte
Merge pull request #1925 from sveltejs/gh-1924
Prevent modification of internal statepull/1928/head
commit
cfb6f52f2b
@ -0,0 +1,5 @@
|
||||
<script>
|
||||
let internal = 1;
|
||||
</script>
|
||||
|
||||
<p>internal: {internal}</p>
|
@ -0,0 +1,18 @@
|
||||
export default {
|
||||
html: `
|
||||
<p>internal: 1</p>
|
||||
<button>click me</button>
|
||||
`,
|
||||
|
||||
async test({ assert, target, window }) {
|
||||
const button = target.querySelector('button');
|
||||
const click = new window.MouseEvent('click');
|
||||
|
||||
await button.dispatchEvent(click);
|
||||
|
||||
assert.htmlEqual(target.innerHTML, `
|
||||
<p>internal: 1</p>
|
||||
<button>click me</button>
|
||||
`);
|
||||
}
|
||||
};
|
@ -0,0 +1,9 @@
|
||||
<script>
|
||||
import Foo from './Foo.html';
|
||||
|
||||
let x = 2;
|
||||
</script>
|
||||
|
||||
<Foo internal={x}/>
|
||||
|
||||
<button on:click="{() => x += 1}">click me</button>
|
Loading…
Reference in new issue