ember-test-helpers
ember-test-helpers copied to clipboard
Not able to use `tab` helper
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?
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
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 https://github.com/1024pix/pix-ui/compare/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:
- Cloning the repo
npm ci(we're using Node 16.14.0)npm testornpm startthen 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
Can confirm it works now, see https://github.com/yannbertrand/ember-test-helpers-tab-reproduction/actions/runs/10476962930/job/29017029938.
Thanks!