2018-07-02 08:35:50 -04:00
|
|
|
import { acceptance } from "helpers/qunit-helpers";
|
|
|
|
|
|
|
|
acceptance("Login with email - no social logins", {
|
|
|
|
settings: {
|
|
|
|
enable_local_logins_via_email: true
|
|
|
|
},
|
2018-07-26 06:16:32 -04:00
|
|
|
pretend(server, helper) {
|
|
|
|
server.post("/u/email-login", () => helper.response({ success: "OK" }));
|
2018-07-02 08:35:50 -04:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2018-07-26 06:16:32 -04:00
|
|
|
QUnit.test("with login with email enabled", async assert => {
|
|
|
|
await visit("/");
|
|
|
|
await click("header .login-button");
|
2018-07-02 08:35:50 -04:00
|
|
|
|
2018-07-26 06:16:32 -04:00
|
|
|
assert.ok(exists(".login-with-email-button"));
|
2018-07-02 08:35:50 -04:00
|
|
|
});
|
|
|
|
|
2018-07-26 06:16:32 -04:00
|
|
|
QUnit.test("with login with email disabled", async assert => {
|
|
|
|
await visit("/");
|
|
|
|
await click("header .login-button");
|
2018-07-02 08:35:50 -04:00
|
|
|
|
2018-07-26 06:16:32 -04:00
|
|
|
assert.notOk(find(".login-buttons").is(":visible"));
|
2018-07-02 08:35:50 -04:00
|
|
|
});
|