FIX: Flaky tests

Locally I was getting a lot of failures from discourse-encrypt due to
leaky state in composer actions. This fixes it.
This commit is contained in:
Robin Ward 2020-07-09 12:58:23 -04:00
parent 52f8eecbb9
commit 10384bcdf4
2 changed files with 2 additions and 6 deletions

View File

@ -13,12 +13,6 @@ acceptance("Composer Actions", {
}, },
site: { site: {
can_tag_topics: true can_tag_topics: true
},
beforeEach() {
_clearSnapshots();
},
afterEach() {
_clearSnapshots();
} }
}); });

View File

@ -22,6 +22,7 @@ import { resetDecorators as resetPluginOutletDecorators } from "discourse/compon
import { resetUsernameDecorators } from "discourse/helpers/decorate-username-selector"; import { resetUsernameDecorators } from "discourse/helpers/decorate-username-selector";
import { resetCache as resetOneboxCache } from "pretty-text/oneboxer"; import { resetCache as resetOneboxCache } from "pretty-text/oneboxer";
import { resetCustomPostMessageCallbacks } from "discourse/controllers/topic"; import { resetCustomPostMessageCallbacks } from "discourse/controllers/topic";
import { _clearSnapshots } from "select-kit/components/composer-actions";
import User from "discourse/models/user"; import User from "discourse/models/user";
export function currentUser() { export function currentUser() {
@ -166,6 +167,7 @@ export function acceptance(name, options) {
resetUsernameDecorators(); resetUsernameDecorators();
resetOneboxCache(); resetOneboxCache();
resetCustomPostMessageCallbacks(); resetCustomPostMessageCallbacks();
_clearSnapshots();
Discourse._runInitializer("instanceInitializers", function( Discourse._runInitializer("instanceInitializers", function(
initName, initName,
initializer initializer