Previously, `resetSite()` would immediately generate a new `Site` instance, and run all the initialization logic within the model. This included initializing Category objects. This was problematic because `resetSite()` is called before any initializers have been run. That means that any modifications to the Site or Category classes would not have any effect on the already-initialized Site/Category instances. This commit makes two main changes so so that the test environment is more production-like: 1. Update `resetSite` so that it simply stores the new data in the PreloadStore, and destroys the old Site instance. Initialization of a new site instance happens 'just in time' (normally during the `inject-discourse-objects` initializer) 2. Update the `helperContext` in tests to use getters. This avoids the need to look up `Site.current()` before initializers have run It also makes a minor adjustment to one test which was relying on a side-effect of the previous behavior. This should resolve the failing tests for discourse-category-expert under Ember-CLI: https://github.com/discourse/discourse-category-experts/pull/69 |
||
|---|---|---|
| .. | ||
| component-test.js | ||
| create-pretender.js | ||
| create-store.js | ||
| d-editor-helper.js | ||
| fixture-pretender.js | ||
| presence-pretender.js | ||
| qunit-helpers.js | ||
| review-pretender.js | ||
| select-kit-helper.js | ||
| site-settings.js | ||
| site.js | ||
| store-pretender.js | ||
| textarea-selection-helper.js | ||
| widget-test.js | ||