mirror of https://github.com/sveltejs/svelte
stringify values before setting text data - fixes #1598
parent
7042f5d2cb
commit
9964a77565
@ -1,22 +1,13 @@
|
|||||||
const data = { foo: null };
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data,
|
data: { foo: null },
|
||||||
|
|
||||||
html: '',
|
html: 'foo is null',
|
||||||
|
|
||||||
test(assert, component, target) {
|
test(assert, component, target) {
|
||||||
assert.htmlEqual(target.innerHTML, 'hi there');
|
component.set({ foo: 42 });
|
||||||
|
assert.htmlEqual(target.innerHTML, 'foo is 42');
|
||||||
data.foo = 'friend';
|
|
||||||
component.set(data);
|
|
||||||
|
|
||||||
assert.htmlEqual(target.innerHTML, 'hi there friend');
|
|
||||||
|
|
||||||
data.foo = null;
|
|
||||||
component.set(data);
|
|
||||||
|
|
||||||
assert.htmlEqual(target.innerHTML, 'hi there');
|
|
||||||
|
|
||||||
|
component.set({ foo: null });
|
||||||
|
assert.htmlEqual(target.innerHTML, 'foo is null');
|
||||||
}
|
}
|
||||||
};
|
};
|
@ -1 +1 @@
|
|||||||
hi there {foo}
|
foo is {foo}
|
Loading…
Reference in new issue