emberjs/ember-test-helpers

Not able to use `tab` helper

Jeyffrey opened this issue · 7 comments

Hello, I need some help !
When I do:
import helpers from '@ember/test-helpers';

In the helpers object, I don't have the tab util.
I already tried with the latest version.

Is it normal? Should I do something specific?

ro0gr commented

have you tried named import:

import { tab } from '@ember/test-helpers';

?

have you tried named import:

import { tab } from '@ember/test-helpers';

?

Yeah I also tried it

ro0gr commented

May you provide with a minimal reproduction? otherwise it'd be impossible to reason about the issue.

We added a trap-focus to a modal component with a modifier, and we wanted to test it.
Here is the current branch 1024pix/pix-ui@dev...pix-5157-add-trap-focus.

Currently, in the project, the @ember/test-helpers version is 2.6.0, but I tried locally with the most recent one.
So, after updating it, I tried to import the tab util, but I wasn't able to do it. Whereas, I have no trouble with the tap one, for example.

Hello @ro0gr,

We've set up a minimal reproduction case.

The GitHub Action CI should fail because of the issue we have.

You can also run it locally with:

  1. Cloning the repo
  2. npm ci (we're using Node 16.14.0)
  3. npm test or npm start then going to http://localhost:4200/tests

The simple test we have is in the /tests/unit/components/trap-focus-test.js file. As you can see there, tap is imported and is a function but tab is not for some reason.

There is a warning because Ember CLI is not tested in our Node version because we're using the Ember 3.18.0 (the same issues occur with Ember 3.27.0) but we guessed it shouldn't cause this particular issue. (Our apps are slowly migrating to Ember 4).

Let us know if we can give you more informations.

Thanks by advance!

This appears to no longer be an issue.

I'm closing this -- but if anyone is still having a problem, please feel free to open a new issue! <3