Test helpers


Ember Basic Dropdown bundles some handy test helpers (clickDropdown and tapDropdown) that make it easier to simulate user interaction in acceptance tests.

You can just have to import them at the top of your tests and call them preceded by await.

import { clickTrigger, tapTrigger } from 'ember-basic-dropdown/test-support/helpers';

clickTrigger(scope = null, eventOptions)

Simulates a click to open or close the dropdown. As all integration test helpers is already runloop aware, so you don't need to wrap it in Ember.run.

In case there is more than one dropdown rendered at the same time you can pass a string with the scope to trigger it over the desired one.

clickTrigger();
assert.equal($('.ember-basic-dropdown-content').length, 1, 'The content is shown now');

tapTrigger(scope = null, eventOptions)

Identical to clickTrigger but simulates a tap instead.

tapTrigger();
assert.equal($('.ember-basic-dropdown-content').length, 1, 'The content is shown now');