Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix types for reorder and drag test helpers #587

Merged
merged 1 commit into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion addon/src/test-support/helpers/drag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ interface Callbacks {

export async function drag(
mode: TMode,
itemSelector: string,
itemSelector: keyof (HTMLElementTagNameMap | SVGElementTagNameMap) | string, // or Parameters<typeof find>[0][]
offsetFn: () => { dx: number; dy: number },
callbacks: Callbacks = {},
) {
Expand Down
6 changes: 3 additions & 3 deletions addon/src/test-support/helpers/reorder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ const OVERSHOOT = 2;
selectors for the resultant order
@return {Promise}
*/
export async function reorder<T extends keyof HTMLElementTagNameMap>(
export async function reorder(
mode: TMode,
itemSelector: string,
...resultSelectors: T[]
itemSelector: keyof (HTMLElementTagNameMap | SVGElementTagNameMap) | string, // or Parameters<typeof findAll>[0],
...resultSelectors: (keyof (HTMLElementTagNameMap | SVGElementTagNameMap) | string)[] // or Parameters<typeof find>[0][]
) {
for (let targetIndex = 0; targetIndex < resultSelectors.length; targetIndex++) {
const items = findAll(itemSelector);
Expand Down