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

Add some testSubject helpers #13305

Merged
merged 6 commits into from
Aug 5, 2017

Conversation

spalger
Copy link
Contributor

@spalger spalger commented Aug 3, 2017

While working on some functional tests I had need for some new testSubject helpers, and an extension to the testSubjects.setValue() helper that makes it support elements that wrap inputs.

Copy link
Contributor

@stacey-gammon stacey-gammon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

couple minor things, but lgtm!

await element.click();

// in case the input element is actually a child of the testSubject, we
// call clearValue() and type() on the element that is focues after
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

focues = focused

});
}

async _mapAll(selectorAll, mapFn) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should use preceding underscores. If you feel strongly about them, and want to diverge from airbnb, lmk and I will open up a "vote" issue so we can add it to our style guide. I don't care too much one way or the other, I just want to be consistent.

https://github.com/airbnb/javascript#naming--leading-underscore

Copy link
Contributor Author

@spalger spalger Aug 3, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh, I would have sworn that this was already part of the Styleguide. I'm pretty firmly against the reasoning at the link, and thought we had already resolved this... If you want to open the vote issue I'm fine with it, but I've been using underscored methods on classes since I started using the class syntax...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#13324 - I'll wait a few before posting in the Kibana chat room if you'd like time to post a counter argument. :)

@spalger spalger merged commit 8ee85f8 into elastic:master Aug 5, 2017
spalger added a commit that referenced this pull request Aug 5, 2017
* [testSubjects] add getVisibleTextAll() helper

* [testSubjects] add isSelected() and isSelectedAll() helpers

* [testSubjects/setValue] support wrappers around inputs

* [testSubjects] add isEnabled() helper

* fix typo

(cherry picked from commit 8ee85f8)
@spalger
Copy link
Contributor Author

spalger commented Aug 5, 2017

6.0: 19f9964
6.1/6.x: 679d8ad

spalger added a commit that referenced this pull request Aug 5, 2017
* [testSubjects] add getVisibleTextAll() helper

* [testSubjects] add isSelected() and isSelectedAll() helpers

* [testSubjects/setValue] support wrappers around inputs

* [testSubjects] add isEnabled() helper

* fix typo

(cherry picked from commit 8ee85f8)
(cherry picked from commit 679d8ad)
@spalger spalger deleted the implement/test-subject-helpers branch August 5, 2017 01:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants