Skip to content

Commit c055092

Browse files
committed
test(drag-element): add JSDocs to dragElementBy
1 parent b840229 commit c055092

1 file changed

Lines changed: 15 additions & 2 deletions

File tree

core/src/utils/test/playwright/drag-element.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,18 @@ import type { ElementHandle, Locator } from '@playwright/test';
1010

1111
import type { E2EPage } from './';
1212

13+
/**
14+
* Drags an element by the given number of pixels on the X and Y axes.
15+
*
16+
* @param el The element to drag.
17+
* @param page The E2E Page object.
18+
* @param dragByX The number of pixels to drag on the X axis. Negative values drag left, positive values drag right.
19+
* @param dragByY The number of pixels to drag on the Y axis. Negative values drag up, positive values drag down.
20+
* @param startXCoord The X coordinate to start the drag from. Defaults to the center of the element.
21+
* @param startYCoord The Y coordinate to start the drag from. Defaults to the center of the element.
22+
* @param releaseDrag Whether to release the drag at the end of the gesture. Defaults to `true`.
23+
* @param steps The number of steps to divide the drag into. More steps reduce velocity; fewer steps increase it. Use this to control whether velocity-based thresholds (e.g. full-swipe) are triggered, particularly in Safari where gesture velocity is calculated relative to animation frames. Defaults to `10`.
24+
*/
1325
export const dragElementBy = async (
1426
el: Locator | ElementHandle<SVGElement | HTMLElement>,
1527
page: E2EPage,
@@ -46,10 +58,11 @@ export const dragElementBy = async (
4658

4759
/**
4860
* Drags an element by the given amount of pixels on the Y axis.
61+
*
4962
* @param el The element to drag.
5063
* @param page The E2E Page object.
51-
* @param dragByY The amount of pixels to drag the element by.
52-
* @param startYCoord The Y coordinate to start the drag gesture at. Defaults to the center of the element.
64+
* @param dragByY The number of pixels to drag on the Y axis.
65+
* @param startYCoord The Y coordinate to start the drag from. Defaults to the center of the element.
5366
*/
5467
export const dragElementByYAxis = async (
5568
el: Locator | ElementHandle<SVGElement | HTMLElement>,

0 commit comments

Comments
 (0)