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

Extract select test helper to an exported function #141

Merged
merged 3 commits into from
Sep 2, 2016

Conversation

Robdel12
Copy link
Collaborator

@Robdel12 Robdel12 commented Sep 1, 2016

Ready for review.

This makes the select helper more robust. First and foremost you can now import the select helper directly:

import { select } from 'yourappname/tests/helpers/x-select';

Also you can pass a jquery object to the helper instead of just a string. This is useful in component integration tests: select(this.$('.x-select'), 'option'). The options are now not case sensitive.

Breaking changes

  • Renamed the file name to x-select

@Robdel12 Robdel12 added this to the v3.0.0 milestone Sep 1, 2016
Ember.Test.registerAsyncHelper('select', function(app, selector, ...texts) {
let $options = app.testHelpers.findWithAssert(`${selector} option`);
// TODO:
// Can you pass an object instead of a string?
Copy link
Collaborator Author

@Robdel12 Robdel12 Sep 1, 2016

Choose a reason for hiding this comment

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

Both would be nice.

(this is me talking to future me)

@Robdel12 Robdel12 changed the title WIP: extract select test helper to an exported function [WIP]: extract select test helper to an exported function Sep 1, 2016
@Robdel12 Robdel12 force-pushed the export-select-test-helper branch from de2fd37 to 4552a07 Compare September 2, 2016 04:11
- You can pass a jquery object or a string for a selector now
- The option you're selecting isn't case sensative anymore
- Rename the helper file name & import for blueprints
@Robdel12 Robdel12 force-pushed the export-select-test-helper branch from d7bc4bb to a425adb Compare September 2, 2016 04:48
@Robdel12 Robdel12 force-pushed the export-select-test-helper branch from a425adb to 30550cd Compare September 2, 2016 04:51
@Robdel12 Robdel12 changed the title [WIP]: extract select test helper to an exported function Extract select test helper to an exported function Sep 2, 2016
@Robdel12 Robdel12 merged commit 3ec2c2f into 3.0.0 Sep 2, 2016
Robdel12 added a commit that referenced this pull request Sep 4, 2016
* WIP: extract select to an exported function

* Make the selector more robust

- You can pass a jquery object or a string for a selector now
- The option you're selecting isn't case sensative anymore
- Rename the helper file name & import for blueprints

* Update README
@Robdel12 Robdel12 deleted the export-select-test-helper branch September 4, 2016 00:31
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.

1 participant