update some tests, delete some no-longer-relevant tests

pull/1864/head
Rich Harris 7 years ago
parent 6e2eeeb88e
commit 23dfe2b135

@ -6,4 +6,4 @@
export let selected;
</script>
<svelte:component this="{ x ? Foo : Bar }" on:select='{event => selected = event.id}'/>
<svelte:component this="{ x ? Foo : Bar }" on:select='{event => selected = event.detail.id}'/>

@ -4,9 +4,7 @@ export default {
`,
test(assert, component, target) {
const { Bar } = component.get();
component.x = Bar;
component.x = component.Bar;
assert.htmlEqual(target.innerHTML, `
<p>Bar</p>

@ -6,13 +6,13 @@ export default {
nestedTransitions: true,
test(assert, component, target) {
const state = component.get();
const Foo = component.Foo;
component.Foo = null;
assert.htmlEqual(target.innerHTML, ``);
component.Foo = state.Foo;
component.Foo = Foo;
assert.htmlEqual(target.innerHTML, `
<p>Foo</p>

@ -2,6 +2,6 @@ export default {
html: `Foo`,
test(assert, component) {
assert.ok(component.refs.test);
assert.ok(component.test);
}
};

@ -1,9 +1,7 @@
<script>
export let test;
import Foo from './Foo.html';
export let foo = Foo;
export let test;
</script>
<svelte:component this={foo} ref:test/>
<svelte:component this={Foo} ref:test/>

@ -1,15 +0,0 @@
export default {
test(assert, component) {
const foo = component.refs.foo;
let count = 0;
foo.on('state', ({ changed }) => {
if (changed.foo) count += 1;
});
assert.equal(count, 0);
component.y = {};
assert.equal(count, 0);
}
};

@ -1,10 +0,0 @@
<script>
export let foo;
import Foo from './Foo.html';
export let x = {};
export let y = {};
</script>
<Foo ref:foo x='{x}'/>

@ -1,8 +0,0 @@
<script>
export let x;
export let y;
export let width;
export let height;
</script>
<rect x='{x}' y='{y}' width='{width}' height='{height}'/>

@ -1,22 +0,0 @@
export default {
props: {
x: 0,
y: 0,
width: 100,
height: 100
},
html: `<svg><rect x="0" y="0" width="100" height="100"></rect></svg>`,
test ( assert, component, target ) {
const svg = target.querySelector( 'svg' );
const rect = target.querySelector( 'rect' );
assert.equal( svg.namespaceURI, 'http://www.w3.org/2000/svg' );
assert.equal( rect.namespaceURI, 'http://www.w3.org/2000/svg' );
component.width = 150;
component.height = 50;
assert.equal( target.innerHTML, `<svg><rect x="0" y="0" width="150" height="50"></rect></svg>` );
},
};

@ -1,12 +0,0 @@
<script>
import Rect from './Rect.html';
export let x;
export let y;
export let width;
export let height;
</script>
<svg>
<Rect x='{x}' y='{y}' width='{width}' height='{height}'/>
</svg>
Loading…
Cancel
Save