DEV: Don't resetSite() more often than needed (#13138)
Avoid calling resetSite() twice per test in certain situations. Included: * DEV: Import `exists` helper
This commit is contained in:
parent
51b360916c
commit
61cf34c09d
|
@ -1,6 +1,7 @@
|
||||||
import {
|
import {
|
||||||
acceptance,
|
acceptance,
|
||||||
count,
|
count,
|
||||||
|
exists,
|
||||||
queryAll,
|
queryAll,
|
||||||
} from "discourse/tests/helpers/qunit-helpers";
|
} from "discourse/tests/helpers/qunit-helpers";
|
||||||
import { click, visit } from "@ember/test-helpers";
|
import { click, visit } from "@ember/test-helpers";
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import {
|
import {
|
||||||
acceptance,
|
acceptance,
|
||||||
|
exists,
|
||||||
queryAll,
|
queryAll,
|
||||||
updateCurrentUser,
|
updateCurrentUser,
|
||||||
} from "discourse/tests/helpers/qunit-helpers";
|
} from "discourse/tests/helpers/qunit-helpers";
|
||||||
|
|
|
@ -219,9 +219,7 @@ export function acceptance(name, optionsOrCallback) {
|
||||||
clearOutletCache();
|
clearOutletCache();
|
||||||
clearHTMLCache();
|
clearHTMLCache();
|
||||||
|
|
||||||
if (siteChanges) {
|
|
||||||
resetSite(currentSettings(), siteChanges);
|
resetSite(currentSettings(), siteChanges);
|
||||||
}
|
|
||||||
|
|
||||||
if (LEGACY_ENV) {
|
if (LEGACY_ENV) {
|
||||||
getApplication().__registeredObjects__ = false;
|
getApplication().__registeredObjects__ = false;
|
||||||
|
@ -253,7 +251,6 @@ export function acceptance(name, optionsOrCallback) {
|
||||||
flushMap();
|
flushMap();
|
||||||
localStorage.clear();
|
localStorage.clear();
|
||||||
User.resetCurrent();
|
User.resetCurrent();
|
||||||
resetSite(currentSettings());
|
|
||||||
resetExtraClasses();
|
resetExtraClasses();
|
||||||
clearOutletCache();
|
clearOutletCache();
|
||||||
clearHTMLCache();
|
clearHTMLCache();
|
||||||
|
|
Loading…
Reference in New Issue