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/acceptance/group-manage-save-button-test.js
Vinoth Kannan 598233456d
FEATURE: Warn admins about private group name's exposure to anonymous users. (#19557)
Group names will be used as CSS classes in some components while rendering the public HTML output. It will happen when a group is set as the default primary for users. Or when a group has either a flair icon or flair upload. So we should warn the admins when they restrict the group's visibility level.

Co-authored-by: Penar Musaraj <pmusaraj@gmail.com>
2022-12-27 13:17:13 +05:30

30 lines
1017 B
JavaScript

import { acceptance, exists } from "discourse/tests/helpers/qunit-helpers";
import selectKit from "discourse/tests/helpers/select-kit-helper";
import { click, visit } from "@ember/test-helpers";
import { test } from "qunit";
acceptance("Managing Group - Save Button", function (needs) {
needs.user();
test("restricting visibility and selecting primary group checkbox", async function (assert) {
await visit("/g/alternative-group/manage/membership");
await click(".groups-form-primary-group");
await click('a[href="/g/alternative-group/manage/interaction"]');
const visibilitySelector = selectKit(
".select-kit.groups-form-visibility-level"
);
await visibilitySelector.expand();
await visibilitySelector.selectRowByValue("1");
assert.ok(exists(".alert-private-group-name"), "alert is shown");
await visibilitySelector.expand();
await visibilitySelector.selectRowByValue("0");
assert.notOk(exists(".alert-private-group-name"), "alert is hidden");
});
});