mirror of https://github.com/sveltejs/svelte
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.
37 lines
563 B
37 lines
563 B
7 years ago
|
export default {
|
||
|
data: {
|
||
|
foo: false,
|
||
|
threshold: 5
|
||
|
},
|
||
|
|
||
|
html: `
|
||
|
<div>1</div>
|
||
|
<div>2</div>
|
||
|
<div>3</div>
|
||
|
<div>4</div>
|
||
|
<div>5</div>
|
||
|
`,
|
||
|
|
||
|
test ( assert, component, target, window, raf ) {
|
||
|
const divs = target.querySelectorAll('div');
|
||
|
|
||
|
raf.tick(100);
|
||
|
|
||
|
component.set({ threshold: 4 });
|
||
|
raf.tick(150);
|
||
|
component.set({ threshold: 5 });
|
||
|
raf.tick(200);
|
||
|
|
||
|
component.set({ threshold: 5.5 });
|
||
|
|
||
|
assert.htmlEqual(target.innerHTML, `
|
||
|
<div>1</div>
|
||
|
<div>2</div>
|
||
|
<div>3</div>
|
||
|
<div>4</div>
|
||
|
<div>5</div>
|
||
|
`);
|
||
|
|
||
|
component.destroy();
|
||
|
}
|
||
|
};
|