OLD | NEW |
| 1 [](https://travis-ci.org/PolymerElements/iron-test-helpers) |
| 2 |
1 # iron-test-helpers | 3 # iron-test-helpers |
2 | 4 |
3 Utility classes to make testing easier. | 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` |
4 | 8 |
5 ## Mock Interactions | 9 ## Mock Interactions |
6 | 10 |
7 This is a set of methods to simulate mouse or keyboard interaction with an eleme
nt. Include `mock-interactions.js` and then use them like so: | 11 This is a set of methods to simulate mouse or keyboard interaction with an eleme
nt. Include `mock-interactions.js` and then use them like so: |
8 | 12 |
9 ```javascript | 13 ```javascript |
10 test('can be triggered with space', function(done) { | 14 test('can be triggered with space', function(done) { |
11 button.addEventListener('keydown', function() { | 15 button.addEventListener('keydown', function() { |
12 done(); | 16 done(); |
13 }); | 17 }); |
14 MockInteractions.pressSpace(button); | 18 MockInteractions.pressSpace(button); |
15 }); | 19 }); |
16 | 20 |
17 test('can be clicked', function(done) { | 21 test('can be clicked', function(done) { |
18 button.addEventListener('click', function() { | 22 button.addEventListener('click', function() { |
19 done(); | 23 done(); |
20 }); | 24 }); |
21 MockInteractions.tap(button); | 25 MockInteractions.tap(button); |
22 }); | 26 }); |
23 ``` | 27 ``` |
OLD | NEW |