Commit Graph

12 Commits

Author SHA1 Message Date
Robin Ward
f113648107
DEV: Migrate more tests to our Ember CLI format. (#11899)
This should be fully backwards compatible.

Co-authored-by: Jarek Radosz <jradosz@gmail.com>

Co-authored-by: Jarek Radosz <jradosz@gmail.com>
2021-02-01 09:01:47 -05:00
Robin Ward
dab2f2fdf4 REFACTOR: We can't use Ember.HTMLBars.compile in Ember CLI
Instead we use the inline `hbs` helper. Note in the non-Ember CLI
version this will not actually inline compile, but it will still work
for all our tests.
2020-11-26 09:27:20 -05:00
Jarek Radosz
dbcf722ab9
DEV: Modulize component tests (#11300)
It's like the new tests, but still old underneath!
2020-11-20 15:54:09 +01:00
Robin Ward
410214e5a9 FIX: In newer embers, it's triggerKeyEvent not keyEvent 2020-11-17 14:46:23 -05:00
Robin Ward
3fc5671e40 REFACTOR: Allow us to import keyEvent
This change should be quite safe as it only adds extra support for
imports rather than global variables.
2020-11-17 09:43:08 -05:00
Robin Ward
0d0ae5e67f REFACTOR: Add support for currentRouteName in test helpers
This replaces the global `currentPath`
2020-11-13 09:31:09 -05:00
Jarek Radosz
ae8c96ed35 DEV: Wait for debounced functions
Modern Ember testing environment requires calling `await settled()` to wait for delayed runloop-aware functions.
2020-11-11 13:32:42 -05:00
Robin Ward
e634513568 Move click and fillIn to imports
Previously they were global functions.
2020-10-27 08:55:56 -04:00
Robin Ward
1e4c0d1857 Remove more global variables from tests.
* Use `sinon` instead of `sandbox` and require an import.
* You need to import `currentURL` to use it.
2020-10-26 13:32:11 -04:00
Robin Ward
b460a6d059 REFACTOR: Continue to converge on what Ember CLI wants us to do
* The creation of a testing div is specific to Rails, so that is
moved back out of setupTests();

* We've removed the `Discourse` globals from the acceptance helpers in favor of
`setApplication`/`getApplication`.

* We pass the container to setupTests because there is no
`__container__` in later Ember versions.

* `App` is now `app` because it's not a constant or class, it's an
instance of an application.
2020-10-16 10:53:13 -04:00
Robin Ward
51d10db7f2 REFACTOR: Import visit helper rather than using a global variable 2020-10-15 13:22:05 -04:00
Robin Ward
3862036422 REFACTOR: Use imports for sinon and setResolver
I also took the opportunity with this commit to move some test specific
stuff out of `discourse-loader` which is loaded on the front end of the
application. The test module building now happens in the `test_helper`
bundle.
2020-10-09 13:54:54 -04:00