~didrocks/+junk/face-detection-15.04

« back to all changes in this revision

Viewing changes to facedetection/www/bower_components/iron-test-helpers/README.md

  • Committer: Didier Roche
  • Date: 2016-05-10 23:09:11 UTC
  • Revision ID: didier.roche@canonical.com-20160510230911-c7xr490zrj3yrzxd
New version

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
[![Build status](https://travis-ci.org/PolymerElements/iron-test-helpers.svg?branch=master)](https://travis-ci.org/PolymerElements/iron-test-helpers)
 
2
 
 
3
# iron-test-helpers
 
4
 
 
5
A set of utility classes to make testing easier. For more details on the methods
 
6
available, please check the documentation of `mock-interactions.js` and
 
7
`test-helpers.js`
 
8
 
 
9
## Mock Interactions
 
10
 
 
11
This is a set of methods to simulate mouse or keyboard interaction with an element. Include `mock-interactions.js` and then use them like so:
 
12
 
 
13
```javascript
 
14
test('can be triggered with space', function(done) {
 
15
  button.addEventListener('keydown', function() {
 
16
    done();
 
17
  });
 
18
  MockInteractions.pressSpace(button);
 
19
});
 
20
 
 
21
test('can be clicked', function(done) {
 
22
  button.addEventListener('click', function() {
 
23
    done();
 
24
  });
 
25
  MockInteractions.tap(button);
 
26
});
 
27
```