DEV: Don't resetSite() more often than needed (#13138)

DEV: Don’t resetSite() more often than needed (#13138)

Avoid calling resetSite() twice per test in certain situations.

Included:

  • DEV: Import exists helper
diff --git a/app/assets/javascripts/discourse/tests/acceptance/group-test.js b/app/assets/javascripts/discourse/tests/acceptance/group-test.js
index 4b400eb..e172429 100644
--- a/app/assets/javascripts/discourse/tests/acceptance/group-test.js
+++ b/app/assets/javascripts/discourse/tests/acceptance/group-test.js
@@ -1,6 +1,7 @@
 import {
   acceptance,
   count,
+  exists,
   queryAll,
 } from "discourse/tests/helpers/qunit-helpers";
 import { click, visit } from "@ember/test-helpers";
diff --git a/app/assets/javascripts/discourse/tests/acceptance/topic-edit-timer-test.js b/app/assets/javascripts/discourse/tests/acceptance/topic-edit-timer-test.js
index 070ee1a..0e3a35a 100644
--- a/app/assets/javascripts/discourse/tests/acceptance/topic-edit-timer-test.js
+++ b/app/assets/javascripts/discourse/tests/acceptance/topic-edit-timer-test.js
@@ -1,5 +1,6 @@
 import {
   acceptance,
+  exists,
   queryAll,
   updateCurrentUser,
 } from "discourse/tests/helpers/qunit-helpers";
diff --git a/app/assets/javascripts/discourse/tests/helpers/qunit-helpers.js b/app/assets/javascripts/discourse/tests/helpers/qunit-helpers.js
index 7a28a0b..86ec6c0 100644
--- a/app/assets/javascripts/discourse/tests/helpers/qunit-helpers.js
+++ b/app/assets/javascripts/discourse/tests/helpers/qunit-helpers.js
@@ -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();

GitHub sha: 61cf34c0

This commit appears in #13138 which was approved by eviltrout. It was merged by CvX.