This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/tests/integration/components/activation-controls-test.js
Vinoth Kannan c7781f1139
UX: respect email_editable site setting in user activation page. (#11835)
Previously, when both `enable_local_logins` and `email_editable` are disabled still user can change the email in  user activation page.
2021-01-25 22:19:26 +05:30

26 lines
615 B
JavaScript

import componentTest, {
setupRenderingTest,
} from "discourse/tests/helpers/component-test";
import {
discourseModule,
queryAll,
} from "discourse/tests/helpers/qunit-helpers";
discourseModule("Integration | Component | activation-controls", function (
hooks
) {
setupRenderingTest(hooks);
componentTest("hides change email button", {
template: `{{activation-controls}}`,
beforeEach() {
this.siteSettings.enable_local_logins = false;
this.siteSettings.email_editable = false;
},
test(assert) {
assert.equal(queryAll("button.edit-email").length, 0);
},
});
});