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/component-slot-spread/_config.js

56 lines
799 B

export default {
props: {
obj: { a: 1, b: 42 },
c: 5,
d: 10
},
html: `
<p>1</p>
<p>42</p>
<p>5</p>
<p>10</p>
`,
test({ assert, target, component }) {
component.obj = { a: 2, b: 50, c: 30 };
assert.htmlEqual(target.innerHTML, `
<p>2</p>
<p>50</p>
<p>30</p>
<p>10</p>
`);
component.c = 22;
assert.htmlEqual(target.innerHTML, `
<p>2</p>
<p>50</p>
<p>30</p>
<p>10</p>
`);
component.d = 44;
assert.htmlEqual(target.innerHTML, `
<p>2</p>
<p>50</p>
<p>30</p>
<p>44</p>
`);
component.obj = { a: 9, b: 12 };
assert.htmlEqual(target.innerHTML, `
<p>9</p>
<p>12</p>
<p>22</p>
<p>44</p>
`);
component.c = 88;
assert.htmlEqual(target.innerHTML, `
<p>9</p>
<p>12</p>
<p>88</p>
<p>44</p>
`);
}
};