-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Description
All the properties that setupApplicationTest() sets up on your test's this context exist properly, except for element (the tests's root element). This is due to two unfortunate coincidences:
this.elementis set up lazily after the firstvisit()call here: https://github.com/emberjs/ember-test-helpers/blob/cce178256ae0e2946c76961fee29fa6d6df6f2fc/addon-test-support/%40ember/test-helpers/setup-application-context.js#L23-L27- yadda does not preserve the context instance, but rather copies all props over to its own context at the beginning of a test run: https://github.com/acuminous/yadda/blob/bd3b74b72bcecdcf2ffa9937b6d0cbc1a36ce03d/lib/Yadda.js#L25
This means the lazily added element does not get added to the actual yadda context that the step function will see, so this.element is undefined there.
Don't know yet how to best fix this. For now you can workaround this by not using this.element but find()/findAll() (exposed by @ember/test-helpers) instead!
Metadata
Metadata
Assignees
Labels
No labels