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/each-block-else/_config.js

38 lines
639 B

export default {
props: {
animals: [ 'alpaca', 'baboon', 'capybara' ],
foo: 'something else'
},
html: `
before
<p>alpaca</p>
<p>baboon</p>
<p>capybara</p>
after
`,
test ( assert, component, target ) {
component.animals = [];
assert.htmlEqual( target.innerHTML, `
before
<p>no animals, but rather something else</p>
after
` );
component.foo = 'something other';
assert.htmlEqual( target.innerHTML, `
before
<p>no animals, but rather something other</p>
after
` );
component.animals = ['wombat'];
assert.htmlEqual( target.innerHTML, `
before
<p>wombat</p>
after
` );
}
};