Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fhengartner/flos-ember-test-helpers
Ember CLI Addon providing test helpers
https://github.com/fhengartner/flos-ember-test-helpers
ember ember-addon ember-testing
Last synced: about 1 month ago
JSON representation
Ember CLI Addon providing test helpers
- Host: GitHub
- URL: https://github.com/fhengartner/flos-ember-test-helpers
- Owner: fhengartner
- License: mit
- Created: 2017-03-20T22:21:54.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-03-22T21:55:52.000Z (almost 8 years ago)
- Last Synced: 2024-10-13T21:36:36.631Z (3 months ago)
- Topics: ember, ember-addon, ember-testing
- Language: JavaScript
- Homepage:
- Size: 21.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# What is flos-ember-test-helpers
This addon provides and registers test helpers for use in the testing of your application.
# Provided Helpers
## clickAndAssertPath
```js
clickAndAssertPath(assert, selector, expectedPath);
```Click on the element specified by `selector` and assert that it has transitioned to route `expectedPath`.
```js
// Example:
clickAndAssertPath(assert, 'button', 'other.route');
```## visitAndAssertPath
```js
visitAndAssertPath(assert, path, expectedPath);
```Visit path and assert that it has transitioned to route `expectedPath`.
```js
// 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-helpers
```## Using 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 the `tests/helpers/start-app.js` file
* Add `import './flos-test-helpers/visit-and-assert-path';` to the beginning of the `tests/helpers/start-app.js` file
* Ignore globals in eslint / jshint
* Add `"clickAndAssertPath": true,` to the globals section of the `.eslintrc`
* Add "clickAndAssertPath", to the predef section of the `/tests/.jshintrc` file