Skip to content

Commit 06f9030

Browse files
committed
test(gestures): browser proof that a scroll-edge pull's first move is cancelled at the edge
spec:AST-094 FR19 and DEC-18 (proposed in meta#8628). The sheet's scroll-edge pan at the top of its content: every touchmove the page sees is cancelled, the first one included. WebKit sends that first move at 2 px, before the sheet's 10 px begin, and it reaches the page uncancelled on this head; Chromium sends none inside its own 15 px slop, so there it proves only that nothing scrolls.
1 parent c6913ba commit 06f9030

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

‎packages/core/src/gestures/__tests__/browser/gestures.browser.spec.ts‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -973,6 +973,25 @@ test('scroll edge: at the top the pull is the sheet’s at once', async ({
973973
expect(await scrollTop(page, 'sheetBody')).toBe(0);
974974
});
975975

976+
test("scroll edge: at the top the sheet cancels the pull's moves from the first one, before it begins (spec:AST-094 FR19, DEC-18)", async ({
977+
page,
978+
browserName,
979+
}) => {
980+
const driver = await open(page, browserName);
981+
await logTouchMoves(page);
982+
const start = await center(page, 'sheetBody');
983+
await driver.play(drag(start, {x: start.x, y: start.y + 24}));
984+
const moves = await readTouchMoves(page);
985+
// WebKit sends the first move at 2 px, well before the sheet's 10 px begin;
986+
// Chromium sends none inside its own 15 px slop. Every move the page sees
987+
// is cancelled, the first one included.
988+
expect(moves.length).toBeGreaterThan(0);
989+
expect(moves).toEqual(moves.map(() => true));
990+
const sheet = (await log(page)).filter(entry => entry.name === 'sheet');
991+
expect(sheet[0]?.state).toBe('began');
992+
expect(await scrollTop(page, 'sheetBody')).toBe(0);
993+
});
994+
976995
test('a drag that began as a scroll stays the browser’s (AST-094 FR14): the content scrolls to its top and the sheet never begins', async ({
977996
page,
978997
browserName,

0 commit comments

Comments
 (0)