parent
08deedfd6e
commit
360289e108
|
@ -373,16 +373,15 @@ export default class CreateAccount extends Component.extend(
|
|||
);
|
||||
}
|
||||
|
||||
const attrs = this.getProperties(
|
||||
"model.accountName",
|
||||
"model.accountEmail",
|
||||
"accountPassword",
|
||||
"model.accountUsername",
|
||||
"accountChallenge",
|
||||
"inviteCode"
|
||||
);
|
||||
|
||||
attrs["accountPasswordConfirm"] = this.accountHoneypot;
|
||||
const attrs = {
|
||||
accountName: this.model.accountName,
|
||||
accountEmail: this.model.accountEmail,
|
||||
accountPassword: this.accountPassword,
|
||||
accountUsername: this.model.accountUsername,
|
||||
accountChallenge: this.accountChallenge,
|
||||
inviteCode: this.inviteCode,
|
||||
accountPasswordConfirm: this.accountHoneypot,
|
||||
};
|
||||
|
||||
const userFields = this.userFields;
|
||||
const destinationUrl = this.get("model.authOptions.destination_url");
|
||||
|
|
|
@ -2,6 +2,10 @@ import { click, fillIn, visit } from "@ember/test-helpers";
|
|||
import { test } from "qunit";
|
||||
import sinon from "sinon";
|
||||
import LoginMethod from "discourse/models/login-method";
|
||||
import pretender, {
|
||||
parsePostData,
|
||||
response,
|
||||
} from "discourse/tests/helpers/create-pretender";
|
||||
import { acceptance } from "discourse/tests/helpers/qunit-helpers";
|
||||
import I18n from "discourse-i18n";
|
||||
|
||||
|
@ -32,10 +36,22 @@ acceptance("Create Account", function () {
|
|||
.dom("#username-validation.good")
|
||||
.exists("the username validation is good");
|
||||
|
||||
pretender.post("/u", (request) => {
|
||||
assert.step("request");
|
||||
const data = parsePostData(request.requestBody);
|
||||
assert.strictEqual(data.name, "Dr. Good Tuna");
|
||||
assert.strictEqual(data.password, "cool password bro");
|
||||
assert.strictEqual(data.email, "good.tuna@test.com");
|
||||
assert.strictEqual(data.username, "good-tuna");
|
||||
return response({ success: true });
|
||||
});
|
||||
|
||||
await click(".modal-footer .btn-primary");
|
||||
assert
|
||||
.dom(".modal-footer .btn-primary:disabled")
|
||||
.exists("create account is disabled");
|
||||
|
||||
assert.verifySteps(["request"]);
|
||||
});
|
||||
|
||||
test("validate username", async function (assert) {
|
||||
|
|
Loading…
Reference in New Issue