Commit Graph

17 Commits

Author SHA1 Message Date
Jarek Radosz d10f95bfad
FIX: Ember test imports, again (#16203)
We use that import also outside of tests…
2022-03-16 17:12:15 +01:00
Jarek Radosz ecfbd45607
FIX: Ember test entries in discourse-loader (#16201)
Those aren't available in the production build.
(+ Move to test-shims)
2022-03-16 16:06:34 +01:00
Jarek Radosz 99b2cfe26e
DEV: Disallow `Ember` global usage (#16147)
…and sprinkle `// eslint-disable-next-line no-undef` throughout the code where is unavoidable for now
2022-03-09 17:54:07 +01:00
Jarek Radosz c528de3288
DEV: Make `settled()` work in the legacy env (#16122)
(and await for `focusComposer`)
2022-03-07 20:00:09 +01:00
Robin Ward 61f5d501cb
DEV: Migrate to Ember CLI (#11932)
This encompasses a lot of work done over the last year, much of which
has already been merged into master. This is the final set of changes
required to get Ember CLI running locally for development.

From here on it will be bug fixes / enhancements.

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

Co-authored-by: Jarek Radosz <jradosz@gmail.com>
Co-authored-by: romanrizzi <rizziromanalejandro@gmail.com>
2021-02-03 14:22:20 -05:00
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