2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-10-03 17:21:20 +08:00
discourse/app/assets/javascripts/discourse/tests/acceptance/modal/login/login-with-email-and-no-social-logins-test.js
Jarek Radosz ef7518d4ad
DEV: Fix no-loose-assertions lint (#29965)
and enable some of qunit lints
2024-11-28 11:22:27 +01:00

24 lines
776 B
JavaScript

import { click, visit } from "@ember/test-helpers";
import { test } from "qunit";
import { acceptance } from "discourse/tests/helpers/qunit-helpers";
acceptance("Login with email - no social logins", function (needs) {
needs.settings({ enable_local_logins_via_email: true });
needs.pretender((server, helper) => {
server.post("/u/email-login", () => helper.response({ success: "OK" }));
});
test("with login with email enabled", async function (assert) {
await visit("/");
await click("header .login-button");
assert.dom("#email-login-link").exists();
});
test("with login with email disabled", async function (assert) {
await visit("/");
await click("header .login-button");
assert.dom(".login-buttons").doesNotExist();
});
});