'selectChoose' integration test is not working
See original GitHub issueWhen i use ‘selectChoose(’.t-select-user’, ‘.ember-power-select-option’, 3); // Third option’ on my integration test i received this message:
Uncaught (in promise) Error: You called "selectChoose('.test-role-selector', '.ember-power-select-option')" but ".ember-power-select-option" didn't match any option at selectChoose$ (http://localhost:4200/assets/tests.js:1631:17) at tryCatch (http://localhost:4200/assets/vendor.js:8619:40) at GeneratorFunctionPrototype.invoke [as _invoke] (http://localhost:4200/assets/vendor.js:8886:22) at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (http://localhost:4200/assets/vendor.js:8652:21) at GeneratorFunctionPrototype.invoke (http://localhost:4200/assets/vendor.js:8694:37) at <anonymous>
I managed to resolve this problem just calling clickTrigger('.test-role-selector');
before call ‘selectChoose’, but accordly to the documentation the ‘selectChoose’ was suposed to care of the entire process of opening a select and choosing.
My test looks like this:
clickTrigger('.test-role-selector');
selectChoose('.test-role-selector', '.ember-power-select-option', 0);
I’m doing something wrong? Why i have to call ‘clickTrigger’?
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (5 by maintainers)
Top GitHub Comments
Ok, that is clear now. Your misconception is that the helper is asynchronous and you need to await for it to finish before asserting the result.
@cibernox I just got stuck on this one too. The docs are misleading:
should be