mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 11:23:25 +08:00
DEV: Avoid extra after-test cleanup (#28846)
This commit is contained in:
parent
6a677d1cfc
commit
2c80203ab9
|
@ -187,6 +187,7 @@ export function testCleanup(container, app) {
|
|||
}
|
||||
|
||||
User.resetCurrent();
|
||||
resetMobile();
|
||||
resetExtraClasses();
|
||||
clearOutletCache();
|
||||
clearHTMLCache();
|
||||
|
@ -249,6 +250,7 @@ export function testCleanup(container, app) {
|
|||
rollbackAllPrepends();
|
||||
clearAboutPageActivities();
|
||||
clearLegacyAboutPageStats();
|
||||
resetWidgetCleanCallbacks();
|
||||
}
|
||||
|
||||
function cleanupCssGeneratorTags() {
|
||||
|
@ -344,8 +346,6 @@ export function acceptance(name, optionsOrCallback) {
|
|||
beforeEach() {
|
||||
I18n.testing = true;
|
||||
|
||||
resetMobile();
|
||||
|
||||
resetExtraClasses();
|
||||
if (mobileView) {
|
||||
forceMobile();
|
||||
|
@ -381,16 +381,10 @@ export function acceptance(name, optionsOrCallback) {
|
|||
|
||||
afterEach() {
|
||||
I18n.testing = false;
|
||||
resetMobile();
|
||||
let app = getApplication();
|
||||
options?.afterEach?.call(this);
|
||||
if (loggedIn) {
|
||||
User.current().statusManager.stopTrackingStatus();
|
||||
}
|
||||
testCleanup(this.container, app);
|
||||
|
||||
// We do this after reset so that the willClearRender will have already fired
|
||||
resetWidgetCleanCallbacks();
|
||||
},
|
||||
};
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ import { hbs } from "ember-cli-htmlbars";
|
|||
import { assert, module, test } from "qunit";
|
||||
import sinon from "sinon";
|
||||
import { overrideThrowGjsError } from "discourse/instance-initializers/component-templates";
|
||||
import { forceMobile, resetMobile } from "discourse/lib/mobile";
|
||||
import { forceMobile } from "discourse/lib/mobile";
|
||||
import { setupRenderingTest } from "discourse/tests/helpers/component-test";
|
||||
import { registerTemporaryModule } from "../helpers/temporary-module-helper";
|
||||
|
||||
|
@ -139,7 +139,6 @@ module("Integration | Initializers | plugin-component-templates", function () {
|
|||
registerBaseComponents();
|
||||
forceMobile();
|
||||
});
|
||||
hooks.afterEach(resetMobile);
|
||||
|
||||
setupRenderingTest(hooks);
|
||||
|
||||
|
@ -176,7 +175,6 @@ module("Integration | Initializers | plugin-component-templates", function () {
|
|||
forceMobile();
|
||||
registerBaseComponents();
|
||||
});
|
||||
hooks.afterEach(resetMobile);
|
||||
|
||||
setupRenderingTest(hooks);
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user