riot-test-utils-jquery
TypeScript icon, indicating that this package has built-in type declarations

1.2.3 • Public • Published

Riot-test-utils-jquery

An official jQuery extension of riot-test-utils.

Currently, this extension is a little experimental.

Installation

Install via NPM

npm i riot-test-utils-jquery -D

Usage

Require once somewhere in your code:

require('riot-test-utils-jquery');
var mount = require('riot-test-utils');

Then, its extension methods are available as ordinaly ones of wrappers.

var wrapper = mount('my-form');
assert(wrapper.find('input[type="submit"]').is(':disabled')); // jQuery.is(selector)

API

You can call some APIs of jQuery as assertion helpers from RiotWrapper andWeakWrapper.

The list of them is below:

  • is
  • has
  • hasClass
  • attr
  • css
  • data
  • prop
  • val

and an escape hatch $() to get jQuery object itself.

Note all of the mutaters like prop('disabled', true) returns the wrapper itself.

Package Sidebar

Install

npm i riot-test-utils-jquery

Weekly Downloads

1

Version

1.2.3

License

MIT

Unpacked Size

6.36 kB

Total Files

5

Last publish

Collaborators

  • karak