DEV: Fix a flaky submodule/auth test (#17313)

This commit is contained in:
Jarek Radosz 2022-07-04 02:25:35 +02:00 committed by GitHub
parent e1f16b4641
commit 7b9e6bb303
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -1,6 +1,7 @@
import I18n from "I18n"; import I18n from "I18n";
import { discourseModule } from "discourse/tests/helpers/qunit-helpers"; import { discourseModule } from "discourse/tests/helpers/qunit-helpers";
import { test } from "qunit"; import { test } from "qunit";
import { settled } from "@ember/test-helpers";
discourseModule("Unit | Controller | create-account", function () { discourseModule("Unit | Controller | create-account", function () {
test("basicUsernameValidation", function (assert) { test("basicUsernameValidation", function (assert) {
@ -38,7 +39,7 @@ discourseModule("Unit | Controller | create-account", function () {
); );
}); });
test("passwordValidation", function (assert) { test("passwordValidation", async function (assert) {
const controller = this.getController("create-account"); const controller = this.getController("create-account");
controller.set("authProvider", ""); controller.set("authProvider", "");
@ -80,6 +81,9 @@ discourseModule("Unit | Controller | create-account", function () {
"pork@chops.com", "pork@chops.com",
I18n.t("user.password.same_as_email") I18n.t("user.password.same_as_email")
); );
// Wait for username check request to finish
await settled();
}); });
test("authProviderDisplayName", function (assert) { test("authProviderDisplayName", function (assert) {