1.2.0 • Published 9 years ago
flos-ember-test-helpers v1.2.0
What is flos-ember-test-helpers
This addon provides and registers test helpers for use in the testing of your application.
Provided Helpers
clickAndAssertPath
clickAndAssertPath(assert, selector, expectedPath);Click on the element specified by selector and assert that it has transitioned to route expectedPath.
// Example:
clickAndAssertPath(assert, 'button', 'other.route');visitAndAssertPath
visitAndAssertPath(assert, path, expectedPath);Visit path and assert that it has transitioned to route expectedPath.
// Example:
visitAndAssertPath(assert, '/a/path', 'a.path');
visitAndAssertPath(assert, '/will/redirect', 'expected.route');How to use this addon in your application
Install
ember install flos-ember-test-helpersUsing in acceptance tests
For each test helper you wish to use, you will need to import them.
- Add
import './flos-test-helpers/click-and-assert-path';to the beginning of thetests/helpers/start-app.jsfile - Add
import './flos-test-helpers/visit-and-assert-path';to the beginning of thetests/helpers/start-app.jsfile - Ignore globals in eslint / jshint
- Add
"clickAndAssertPath": true,to the globals section of the.eslintrc - Add "clickAndAssertPath", to the predef section of the
/tests/.jshintrcfile
- Add
1.2.0
9 years ago