mirror of
https://github.com/hanzoai/forum.git
synced 2026-09-30 21:51:19 +00:00
Enables our new eslint rules which enforce consistent i18n imports. For more info, see https://github.com/discourse/lint-configs/commit/0d58b40cd7d170a9f70bcef5c173f95eeb498298
46 lines
1.3 KiB
JavaScript
46 lines
1.3 KiB
JavaScript
import { click, fillIn, visit } from "@ember/test-helpers";
|
|
import { test } from "qunit";
|
|
import { acceptance } from "discourse/tests/helpers/qunit-helpers";
|
|
import { i18n } from "discourse-i18n";
|
|
|
|
acceptance("User Preferences - Email", function (needs) {
|
|
needs.user();
|
|
|
|
needs.pretender((server, helper) => {
|
|
server.put("/u/eviltrout/preferences/email", () => {
|
|
return helper.response({
|
|
success: true,
|
|
});
|
|
});
|
|
});
|
|
|
|
test("email", async function (assert) {
|
|
await visit("/u/eviltrout/preferences/email");
|
|
|
|
assert.dom("#change-email").exists("has the input element");
|
|
|
|
await fillIn("#change-email", "invalid-email");
|
|
|
|
assert
|
|
.dom(".tip.bad")
|
|
.hasText(
|
|
i18n("user.email.invalid"),
|
|
"it should display invalid email tip"
|
|
);
|
|
});
|
|
|
|
test("email field always shows up", async function (assert) {
|
|
await visit("/u/eviltrout/preferences/email");
|
|
|
|
assert.dom("#change-email").exists("has the input element");
|
|
|
|
await fillIn("#change-email", "[email protected]");
|
|
await click(".user-preferences button.btn-primary");
|
|
|
|
await visit("/u/eviltrout/preferences");
|
|
await visit("/u/eviltrout/preferences/email");
|
|
|
|
assert.dom("#change-email").exists("has the input element");
|
|
});
|
|
});
|