{"id":13114,"library":"ember-cli-browser-navigation-button-test-helper","title":"Ember Browser Navigation Button Test Helper","description":"This package, `ember-cli-browser-navigation-button-test-helper`, provides critical test helpers for simulating browser back and forward button clicks within Ember.js acceptance tests. It exports `setupBrowserNavigationButtons()`, `backButton()`, and `forwardButton()`, enabling developers to thoroughly test navigation flows that involve browser history manipulation. The current stable version is v0.3.0, actively maintained, with releases typically aligning with Ember.js and Ember CLI compatibility updates. Its primary differentiation lies in offering a robust, standardized, and modern Ember-compatible solution for a common testing challenge, where manual DOM manipulation or less integrated approaches might be flaky or difficult to maintain. It specifically targets modern Ember testing paradigms (Ember.js v3.20+ and RFC #232/#268 acceptance tests), ensuring compatibility and best practices.","status":"active","version":"0.3.0","language":"javascript","source_language":"en","source_url":"https://github.com/jelhan/ember-cli-browser-navigation-button-test-helpers","tags":["javascript","ember-addon"],"install":[{"cmd":"npm install ember-cli-browser-navigation-button-test-helper","lang":"bash","label":"npm"},{"cmd":"yarn add ember-cli-browser-navigation-button-test-helper","lang":"bash","label":"yarn"},{"cmd":"pnpm add ember-cli-browser-navigation-button-test-helper","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"This addon provides test helpers primarily for Ember's ESM-based testing environment. CommonJS `require` syntax is generally incorrect in modern Ember acceptance tests.","wrong":"const setupBrowserNavigationButtons = require('ember-cli-browser-navigation-button-test-helper/test-support');","symbol":"setupBrowserNavigationButtons","correct":"import { setupBrowserNavigationButtons } from 'ember-cli-browser-navigation-button-test-helper/test-support';"},{"note":"The addon uses named exports for all its helper functions. Importing as a default export will result in `undefined` or a `TypeError`.","wrong":"import backButton from 'ember-cli-browser-navigation-button-test-helper/test-support';","symbol":"backButton","correct":"import { backButton } from 'ember-cli-browser-navigation-button-test-helper/test-support';"},{"note":"All helpers must be imported from the `/test-support` subpath, not the root package path. Aliasing is fine, but the path must be correct.","wrong":"import { forwardButton as fb } from 'ember-cli-browser-navigation-button-test-helper';","symbol":"forwardButton","correct":"import { forwardButton } from 'ember-cli-browser-navigation-button-test-helper/test-support';"}],"quickstart":{"code":"import { module, test } from 'qunit';\nimport { visit, currentURL } from '@ember/test-helpers';\nimport { setupApplicationTest } from 'ember-qunit';\nimport { setupBrowserNavigationButtons, backButton, forwardButton } from 'ember-cli-browser-navigation-button-test-helper/test-support';\n\nmodule('Acceptance | browser navigation', function(hooks) {\n  setupApplicationTest(hooks);\n  setupBrowserNavigationButtons(hooks); // Essential: registers the history service\n\n  test('navigating and using back/forward buttons', async function(assert) {\n    assert.expect(4);\n\n    await visit('/');\n    assert.equal(currentURL(), '/', 'Starts at the root URL.');\n\n    await visit('/items');\n    assert.equal(currentURL(), '/items', 'Navigates to /items.');\n\n    await backButton();\n    assert.equal(currentURL(), '/', 'Goes back to the root URL.');\n\n    await forwardButton();\n    assert.equal(currentURL(), '/items', 'Goes forward to /items.');\n  });\n});","lang":"javascript","description":"Demonstrates setting up the browser navigation test helpers and simulating back/forward actions within an Ember acceptance test."},"warnings":[{"fix":"Upgrade your Ember.js application to v3.20 or newer, or pin `ember-cli-browser-navigation-button-test-helper` to a version prior to 0.3.0.","message":"Version 0.3.0 drops support for Ember.js versions older than 3.20. Applications using older Ember versions must remain on v0.2.0 or earlier.","severity":"breaking","affected_versions":">=0.3.0"},{"fix":"Consult the `ember-auto-import` v2 migration guide for any necessary configuration adjustments in your `ember-cli-build.js` or `package.json`.","message":"Version 0.3.0 includes an update to `ember-auto-import` v2. This may require changes in your Ember CLI build configuration if you were using specific `ember-auto-import` v1 settings.","severity":"breaking","affected_versions":">=0.3.0"},{"fix":"Migrate your acceptance tests to the modern RFC #232 and #268 syntax and setup, or downgrade `ember-cli-browser-navigation-button-test-helper` to v0.0.5.","message":"Support for 'old-style' acceptance tests (before RFC #232 and #268) was dropped in v0.1.0. If your application still uses this older testing pattern, you must use v0.0.5.","severity":"breaking","affected_versions":">=0.1.0"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"Ensure `setupBrowserNavigationButtons(hooks);` is called immediately after `setupApplicationTest(hooks);` within your QUnit `module` setup.","cause":"The `setupBrowserNavigationButtons(hooks)` helper was not called at the beginning of your test module.","error":"TypeError: backButton is not a function"},{"fix":"Correct the import statements to `from 'ember-cli-browser-navigation-button-test-helper/test-support';`","cause":"Attempting to import helpers from the root package path instead of the specific test-support path.","error":"Import path not found: ember-cli-browser-navigation-button-test-helper"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":""}