You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
svelte/test/runtime/samples/spread-component-dynamic-no.../_config.js

52 lines
984 B

export default {
props: {
props: {
foo: 'lol',
baz: 40 + 2,
}
},
html: `
<div><p>foo: lol</p>
<p>baz: 42</p>
<p>qux: named</p>
`,
test({ assert, component, target }) {
const html = `
<div><p>foo: undefined</p>
<p>baz: undefined</p>
<p>qux: named</p>
`;
// test undefined
component.props = undefined;
assert.htmlEqual(target.innerHTML, html);
// set object props
component.props = this.props.props;
assert.htmlEqual(target.innerHTML, this.html);
// test null
component.props = null;
assert.htmlEqual(target.innerHTML, html);
// set object props
component.props = this.props.props;
assert.htmlEqual(target.innerHTML, this.html);
// test boolean
component.props = true;
assert.htmlEqual(target.innerHTML, html);
// set object props
component.props = this.props.props;
assert.htmlEqual(target.innerHTML, this.html);
// test number
component.props = 123;
assert.htmlEqual(target.innerHTML, html);
}
};