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

Make sure findOne throws if no elements are found #24

Merged
merged 1 commit into from
Sep 3, 2019
Merged

Conversation

twokul
Copy link
Contributor

@twokul twokul commented May 21, 2019

If you have the following code:

// in this case, `findOne` couldn't find any elements with `displayName: 'some name'`
PAGE.elements.findOne({ displayName: 'some name' }).anotherElement.click()

it throws with not very helpful message: Cannot read property 'anotherElement' of undefined.

This change adds a more helpful error: Expected at most one result from 'findOne' query in 'elements' collection.

cc @NicholasMohr

@twokul twokul requested a review from pzuraq May 21, 2019 23:26
@NicholasMohr
Copy link

@pzuraq easy review, I've already approved but I don't have write access, so either giving me write access or reviewing the PR are easy steps to make this PR go away 😄

@NicholasMohr
Copy link

@pzuraq bump, only you can save us!

@pzuraq easy review, I've already approved but I don't have write access, so either giving me write access or reviewing the PR are easy steps to make this PR go away 😄

@pzuraq
Copy link
Contributor

pzuraq commented Sep 3, 2019

Added you as a collaborator, @twokul should already be one. Feel free to merge/release as you guys need, I'm not able to help out with this lib unfortunately at the moment, happy to transfer it if you want it to be on the Addepar github org too

@NicholasMohr
Copy link

ok thanks very much, wasn't aware @twokul was one, will let you know if we decide to transfer it!

@NicholasMohr NicholasMohr merged commit ad2a47d into master Sep 3, 2019
@NicholasMohr NicholasMohr deleted the find-one branch September 3, 2019 18:14
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 this pull request may close these issues.

3 participants