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

Return type of handle is incorrect #557

Open
aboyton opened this issue Feb 12, 2025 · 0 comments · May be fixed by #558
Open

Return type of handle is incorrect #557

aboyton opened this issue Feb 12, 2025 · 0 comments · May be fixed by #558
Assignees

Comments

@aboyton
Copy link

aboyton commented Feb 12, 2025

element.handle doesn't particularly well documented (only reference I can see is https://suite.st/docs/suitest-api/assertions-test-subjects/#element so I'm not quite sure what the multiple flag does), but it appears the return type doesn't always match what it actually returns.

From manual testing, it seems multiple: true makes handle return an array of strings, and without it, it returns a string.

await suitest.element({active: true}).handle(); // string
await suitest.element({active: true}).handle({multiple: false}); // string
await suitest.element({active: true}).handle({multiple: true}); // string[]

Instead it always returns string[].

@aboyton aboyton linked a pull request Feb 12, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants