FIX: Set resolver options on the legacy resolver (#17440)

This commit is contained in:
Jarek Radosz 2022-07-12 11:42:19 +02:00 committed by GitHub
parent e15c63027f
commit 6c3e262a7c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 3 deletions

View File

@ -1,5 +1,6 @@
import Mobile from "discourse/lib/mobile";
import { setResolverOption } from "discourse-common/resolver";
import { setResolverOption as setLegacyResolverOption } from "discourse-common/lib/legacy-resolver";
// Initializes the `Mobile` helper object.
export default {
@ -14,5 +15,6 @@ export default {
site.set("isMobileDevice", Mobile.isMobileDevice);
setResolverOption("mobileView", Mobile.mobileView);
setLegacyResolverOption("mobileView", Mobile.mobileView);
},
};

View File

@ -7,7 +7,6 @@ import { autoLoadModules } from "discourse/initializers/auto-load-modules";
import QUnit, { test } from "qunit";
import { setupRenderingTest as emberSetupRenderingTest } from "ember-qunit";
import { currentSettings } from "discourse/tests/helpers/site-settings";
import { clearResolverOptions } from "discourse-common/resolver";
import { testCleanup } from "discourse/tests/helpers/qunit-helpers";
export function setupRenderingTest(hooks) {
@ -22,7 +21,6 @@ export function setupRenderingTest(hooks) {
}
this.container = this.owner;
clearResolverOptions();
}
this.site = Site.current();

View File

@ -47,6 +47,7 @@ import sinon from "sinon";
import siteFixtures from "discourse/tests/fixtures/site-fixtures";
import { clearExtraKeyboardShortcutHelp } from "discourse/lib/keyboard-shortcuts";
import { clearResolverOptions } from "discourse-common/resolver";
import { clearResolverOptions as clearLegacyResolverOptions } from "discourse-common/lib/legacy-resolver";
import { clearNavItems } from "discourse/models/nav-item";
import {
cleanUpComposerUploadHandler,
@ -192,6 +193,8 @@ export function testCleanup(container, app) {
clearTagDecorateCallbacks();
clearBlockDecorateCallbacks();
clearTextDecorateCallbacks();
clearResolverOptions();
clearLegacyResolverOptions();
}
export function discourseModule(name, options) {
@ -207,8 +210,8 @@ export function discourseModule(name, options) {
this.registry = this.container.registry;
this.owner = this.container;
this.siteSettings = currentSettings();
clearResolverOptions();
});
hooks.afterEach(() => testCleanup(this.container));
this.getController = function (controllerName, properties) {