{"id":16804,"library":"ember-simulant-test-helpers","title":"Ember Simulant Test Helpers","description":"This package, `ember-simulant-test-helpers`, provides specialized Ember test helpers for simulating complex DOM interactions, particularly multi-touch gestures like panning. It achieves this by utilizing `simulant.js` to generate highly realistic synthetic DOM events. This allows for more granular control over event sequences than typically offered by standard Ember test helpers, enabling comprehensive testing of components that respond to advanced user interactions. The package is currently at version 0.3.2. Due to its last update being several years ago and its 0.x versioning, it is effectively abandoned and unlikely to receive further updates or compatibility fixes for newer Ember or JavaScript ecosystem versions. Its primary differentiator was its direct integration with `simulant.js` for detailed event simulation, offering a level of event fidelity often missing in basic test utilities.","status":"abandoned","version":"0.3.2","language":"javascript","source_language":"en","source_url":"https://github.com/yapplabs/ember-simulant-test-helpers","tags":["javascript","ember-addon"],"install":[{"cmd":"npm install ember-simulant-test-helpers","lang":"bash","label":"npm"},{"cmd":"yarn add ember-simulant-test-helpers","lang":"bash","label":"yarn"},{"cmd":"pnpm add ember-simulant-test-helpers","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core dependency for generating DOM events.","package":"simulant","optional":false},{"reason":"Peer dependency for Ember addon functionality.","package":"ember-cli","optional":false},{"reason":"Required for general Ember testing utilities like `find` and `render`.","package":"@ember/test-helpers","optional":false}],"imports":[{"note":"Ember applications typically use ESM imports. CommonJS `require` will not work in modern Ember test environments.","wrong":"const panX = require('ember-simulant-test-helpers');","symbol":"panX","correct":"import { panX } from 'ember-simulant-test-helpers';"},{"note":"The library exports various gesture helpers like `panY` for vertical panning, alongside `panX`.","symbol":"panY","correct":"import { panY } from 'ember-simulant-test-helpers';"},{"note":"While `panX` is shown, the library provides a range of gesture-based helpers for simulating complex interactions such as `swipe`.","symbol":"swipe","correct":"import { swipe } from 'ember-simulant-test-helpers';"}],"quickstart":{"code":"import { find, render } from '@ember/test-helpers';\nimport { setupRenderingTest } from 'ember-qunit';\nimport { module, test } from 'qunit';\nimport { panX } from 'ember-simulant-test-helpers';\n\nmodule('Integration | Helper | panX', function(hooks) {\n  setupRenderingTest(hooks);\n\n  test('it can simulate a horizontal pan gesture', async function(assert) {\n    await render('<div class=\"my-swipe-aware-thingy\" style=\"width: 200px; height: 100px; touch-action: none;\"></div>');\n\n    const element = find('.my-swipe-aware-thingy');\n    let panDetected = false;\n    element.addEventListener('panstart', () => panDetected = true);\n    element.addEventListener('panend', () => assert.true(panDetected, 'Pan start should be detected'));\n\n    await panX(element, {\n      position: [50, 50],\n      amount: 100,\n      duration: 100\n    });\n\n    assert.dom('.my-swipe-aware-thingy').exists('The element should still be in the DOM');\n    // In a real test, you'd assert on application state changes or CSS transformations\n  });\n});","lang":"javascript","description":"Demonstrates how to import and use the `panX` helper within an Ember rendering test to simulate a horizontal pan gesture on a DOM element."},"warnings":[{"fix":"Consider migrating to actively maintained Ember testing utilities or exploring alternatives for advanced DOM event simulation. Manual event dispatching with modern browser APIs might be a more stable approach.","message":"The project is effectively abandoned, with its last commit several years ago. It is unlikely to receive updates for compatibility with newer Ember versions (e.g., Ember 4.x+ or Octane) or modern browser APIs. Users might encounter silent failures or unexpected behavior.","severity":"breaking","affected_versions":">=0.3.2"},{"fix":"While `npm install --force` or `npm install --legacy-peer-deps` might bypass installation errors, runtime compatibility issues with newer Node versions are likely. It's recommended to test thoroughly in a modern environment or avoid this package for new projects.","message":"The specified Node.js engine versions (`10.* || >= 12`) are significantly outdated. Running this package with recent Node.js versions (e.g., Node 16+) may lead to compatibility issues, warnings during installation, or runtime errors.","severity":"gotcha","affected_versions":">=0.3.2"},{"fix":"Thoroughly test existing implementations and document current behavior. For new features or projects, prioritize alternative solutions with stable APIs and active maintenance.","message":"The package's 0.x versioning indicates that its API was never considered stable. While it has not changed since 0.3.2, relying on an unstable API from an abandoned project introduces significant long-term maintenance risk.","severity":"gotcha","affected_versions":">=0.3.2"},{"fix":"Manually verify the simulated events against real browser behavior, especially for critical interactions. Be aware that the fidelity of older event simulation libraries might degrade over time as browser standards evolve.","message":"The underlying `simulant.js` library, which `ember-simulant-test-helpers` depends on, might also be outdated. Its event simulation methods may not accurately reflect current browser event models or touch event specifications, potentially leading to 'false positive' tests.","severity":"gotcha","affected_versions":">=0.3.2"}],"env_vars":null,"last_verified":"2026-04-22T00:00:00.000Z","next_check":"2026-07-21T00:00:00.000Z","problems":[{"fix":"Ensure the package is installed via `ember install ember-simulant-test-helpers` and use ES module `import { helperName } from 'ember-simulant-test-helpers';` syntax. Verify `node_modules` contains the package.","cause":"Attempting to import the package using CommonJS `require()` syntax in a modern Ember CLI project, or the package was not properly installed or linked.","error":"Module not found: Error: Can't resolve 'ember-simulant-test-helpers'"},{"fix":"Double-check the import statement for typos: `import { panX } from 'ember-simulant-test-helpers';`. Ensure `ember install ember-simulant-test-helpers` was run successfully and that your Ember CLI version supports the package's integration method.","cause":"The `ember-simulant-test-helpers` package might not be correctly integrated into the Ember testing environment, or the import path is incorrect, leading to an undefined module.","error":"TypeError: Cannot read properties of undefined (reading 'panX')"},{"fix":"Verify that your `await render(...)` call renders the target element before `panX` is invoked. Check for typos in the selector passed to `find` and ensure the component is correctly rendered and visible in the test context.","cause":"This error originates from `@ember/test-helpers`, indicating that the element you're trying to interact with using `panX` (or other helpers) does not exist in the DOM when the test helper is called.","error":"Error: `find` was called but no element was found for selector '.my-swipe-aware-thingy'."}],"ecosystem":"npm","meta_description":null}