mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
* DEV: Remove server global test variable * Delete yarn-error.log * prettier and some eslint fixes * add global server variable back for plugins * rename imported server to pretender * prettier * support plugin server. usage * Export pretender as named * Prettier * change default pretender export * fix bad import * Use pretender() and original default export * export new Pretender as default * fix accidental change * WIP testing * add pretend handlers in correct location * move more stuff into the correct pretender * Consolidated more pretenders * comment out another bad test * fix user acceptance tests * commented out bad test * fixed another composer server stub * fix more tests * fixed tag test pretender * Fix admin email test * removed another draft handler * add back test * fix and uncomment another test * remove test that is not useful * remove commented out lines * reapply handlers between every test * no need to re-stub requests now :) * cleanup from review * more cleanup
36 lines
964 B
JavaScript
36 lines
964 B
JavaScript
import { acceptance } from "helpers/qunit-helpers";
|
|
import pretender from "helpers/create-pretender";
|
|
|
|
acceptance("Login with email - hide email address taken", {
|
|
settings: {
|
|
enable_local_logins_via_email: true,
|
|
hide_email_address_taken: true
|
|
},
|
|
beforeEach() {
|
|
const response = object => {
|
|
return [200, { "Content-Type": "application/json" }, object];
|
|
};
|
|
|
|
pretender.post("/u/email-login", () => {
|
|
return response({ success: "OK" });
|
|
});
|
|
}
|
|
});
|
|
|
|
QUnit.test("with hide_email_address_taken enabled", async assert => {
|
|
await visit("/");
|
|
await click("header .login-button");
|
|
await fillIn("#login-account-name", "someuser@example.com");
|
|
await click(".login-with-email-button");
|
|
|
|
assert.equal(
|
|
find(".alert-success")
|
|
.html()
|
|
.trim(),
|
|
I18n.t("email_login.complete_email_found", {
|
|
email: "someuser@example.com"
|
|
}),
|
|
"it should display the success message for any email address"
|
|
);
|
|
});
|