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:
Jarek Radosz 2021-05-25 18:38:41 +02:00 committed by GitHub
parent 51b360916c
commit 61cf34c09d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 4 deletions

View File

@ -1,6 +1,7 @@
import {
acceptance,
count,
exists,
queryAll,
} from "discourse/tests/helpers/qunit-helpers";
import { click, visit } from "@ember/test-helpers";

View File

@ -1,5 +1,6 @@
import {
acceptance,
exists,
queryAll,
updateCurrentUser,
} from "discourse/tests/helpers/qunit-helpers";

View File

@ -219,9 +219,7 @@ export function acceptance(name, optionsOrCallback) {
clearOutletCache();
clearHTMLCache();
if (siteChanges) {
resetSite(currentSettings(), siteChanges);
}
resetSite(currentSettings(), siteChanges);
if (LEGACY_ENV) {
getApplication().__registeredObjects__ = false;
@ -253,7 +251,6 @@ export function acceptance(name, optionsOrCallback) {
flushMap();
localStorage.clear();
User.resetCurrent();
resetSite(currentSettings());
resetExtraClasses();
clearOutletCache();
clearHTMLCache();