File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -37,6 +37,27 @@ describe('quicklink tests', function () {
3737 expect(responseURLs).to.include(`${server}/3.html`);
3838 });
3939
40+ it('should prefetch in-viewport links that scroll into view correctly (UMD)', async function () {
41+ const responseURLs = [];
42+ page.on('response', resp => {
43+ responseURLs.push(resp.url());
44+ });
45+ await page.goto(`${server}/test-basic-usage.html`);
46+ await page.setViewport({
47+ width: 1200,
48+ height: 800,
49+ });
50+ await page.evaluate(_ => {
51+ window.scrollBy(0, window.innerHeight);
52+ });
53+ await page.waitFor(1000);
54+ expect(responseURLs).to.be.an('array');
55+ expect(responseURLs).to.include(`${server}/1.html`);
56+ expect(responseURLs).to.include(`${server}/2.html`);
57+ expect(responseURLs).to.include(`${server}/3.html`);
58+ expect(responseURLs).to.include(`${server}/4.html`);
59+ });
60+
4061 it('should prefetch a static list of URLs correctly', async function () {
4162 const responseURLs = [];
4263 page.on('response', resp => {
You can’t perform that action at this time.
0 commit comments