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/transition-js-each-unchanged/_config.js

26 lines
673 B

export default {
props: {
numbers: [1, 2, 3, 4, 5]
},
test({ assert, component, target, raf }) {
const divs1 = target.querySelectorAll('div');
assert.equal(divs1[0].foo, undefined);
component.numbers = [1, 2, 5, 4, 3];
const divs2 = target.querySelectorAll('div');
assert.equal(divs1[0], divs2[0]);
assert.equal(divs1[1], divs2[1]);
assert.equal(divs1[2], divs2[2]);
assert.equal(divs1[3], divs2[3]);
assert.equal(divs1[4], divs2[4]);
assert.equal(divs1[0].foo, undefined);
assert.equal(divs1[1].foo, undefined);
assert.equal(divs1[2].foo, undefined);
assert.equal(divs1[3].foo, undefined);
assert.equal(divs1[4].foo, undefined);
}
};