From b35613c35c004ffe1f4cd9b8a46eec28e41bb7ba Mon Sep 17 00:00:00 2001 From: BoussonKarel Date: Fri, 27 Sep 2024 09:14:23 +0200 Subject: [PATCH] fix types for reorder and drag test helpers --- addon/src/test-support/helpers/drag.ts | 2 +- addon/src/test-support/helpers/reorder.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/addon/src/test-support/helpers/drag.ts b/addon/src/test-support/helpers/drag.ts index f8e2e668..1f8a8240 100644 --- a/addon/src/test-support/helpers/drag.ts +++ b/addon/src/test-support/helpers/drag.ts @@ -37,7 +37,7 @@ interface Callbacks { export async function drag( mode: TMode, - itemSelector: string, + itemSelector: keyof (HTMLElementTagNameMap | SVGElementTagNameMap) | string, // or Parameters[0][] offsetFn: () => { dx: number; dy: number }, callbacks: Callbacks = {}, ) { diff --git a/addon/src/test-support/helpers/reorder.ts b/addon/src/test-support/helpers/reorder.ts index 776b8ee1..551d2e7c 100644 --- a/addon/src/test-support/helpers/reorder.ts +++ b/addon/src/test-support/helpers/reorder.ts @@ -26,10 +26,10 @@ const OVERSHOOT = 2; selectors for the resultant order @return {Promise} */ -export async function reorder( +export async function reorder( mode: TMode, - itemSelector: string, - ...resultSelectors: T[] + itemSelector: keyof (HTMLElementTagNameMap | SVGElementTagNameMap) | string, // or Parameters[0], + ...resultSelectors: (keyof (HTMLElementTagNameMap | SVGElementTagNameMap) | string)[] // or Parameters[0][] ) { for (let targetIndex = 0; targetIndex < resultSelectors.length; targetIndex++) { const items = findAll(itemSelector);