iron-test-helpers

WebJar for iron-test-helpers

License

License

BSD 3-Clause
GroupId

GroupId

org.webjars.bowergithub.polymerelements
ArtifactId

ArtifactId

iron-test-helpers
Last Version

Last Version

2.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

iron-test-helpers
WebJar for iron-test-helpers
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/PolymerElements/iron-test-helpers

Download iron-test-helpers

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.bowergithub.polymerelements/iron-test-helpers/ -->
<dependency>
    <groupId>org.webjars.bowergithub.polymerelements</groupId>
    <artifactId>iron-test-helpers</artifactId>
    <version>2.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.bowergithub.polymerelements/iron-test-helpers/
implementation 'org.webjars.bowergithub.polymerelements:iron-test-helpers:2.0.1'
// https://jarcasting.com/artifacts/org.webjars.bowergithub.polymerelements/iron-test-helpers/
implementation ("org.webjars.bowergithub.polymerelements:iron-test-helpers:2.0.1")
'org.webjars.bowergithub.polymerelements:iron-test-helpers:jar:2.0.1'
<dependency org="org.webjars.bowergithub.polymerelements" name="iron-test-helpers" rev="2.0.1">
  <artifact name="iron-test-helpers" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.bowergithub.polymerelements', module='iron-test-helpers', version='2.0.1')
)
libraryDependencies += "org.webjars.bowergithub.polymerelements" % "iron-test-helpers" % "2.0.1"
[org.webjars.bowergithub.polymerelements/iron-test-helpers "2.0.1"]

Dependencies

compile (1)

Group / Artifact Type Version
org.webjars.bowergithub.polymer : polymer jar [1.9.0,3)

Project Modules

There are no modules declared in this project.

Published on NPM Build status Published on webcomponents.org

iron-test-helpers

A set of utility classes to make testing easier. For more details on the methods available, please check the documentation of mock-interactions.js and test-helpers.js

See: Documentation.

Usage

Mock Interactions

This is a set of methods to simulate mouse or keyboard interaction with an element.

import {pressSpace, tap} from '@polymer/iron-test-helpers/mock-interactions.js';

test('can be triggered with space', function(done) {
  button.addEventListener('keydown', function() {
    done();
  });
  pressSpace(button);
});

test('can be clicked', function(done) {
  button.addEventListener('click', function() {
    done();
  });
  tap(button);
});

Note on globals

Note that in version 3.x, importing mock-interactions.js and test-helpers.js will also set the window.MockInteractions and window.TestHelpers globals, respectively (and importing iron-test-helpers.js will set both). This is done only for backwards compatibility, and will be removed in the next major version. All users should migrate away from globals and onto direct ES module imports.

Contributing

If you want to send a PR to this element, here are the instructions for running the tests and demo locally:

Installation

git clone https://github.com/PolymerElements/iron-test-helpers
cd iron-test-helpers
npm install
npm install -g polymer-cli

Running the tests

polymer test --npm
org.webjars.bowergithub.polymerelements

Versions

Version
2.0.1
2.0.0