mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: set notification levels when added to a group (#10378)
* FEATURE: set notification levels when added to a group This feature allows admins and group owners to define default category and tag tracking levels that will be applied to user preferences automatically at the time when users are added to the group. Users are free to change those preferences afterwards. When removed from a group, the user's notification preferences aren't changed.
This commit is contained in:
33
test/javascripts/acceptance/group-manage-categories-test.js
Normal file
33
test/javascripts/acceptance/group-manage-categories-test.js
Normal file
@@ -0,0 +1,33 @@
|
||||
import { acceptance, updateCurrentUser } from "helpers/qunit-helpers";
|
||||
|
||||
acceptance("Managing Group Category Notification Defaults");
|
||||
QUnit.test("As an anonymous user", async assert => {
|
||||
await visit("/g/discourse/manage/categories");
|
||||
|
||||
assert.ok(
|
||||
count(".group-members tr") > 0,
|
||||
"it should redirect to members page for an anonymous user"
|
||||
);
|
||||
});
|
||||
|
||||
acceptance("Managing Group Category Notification Defaults", { loggedIn: true });
|
||||
|
||||
QUnit.test("As an admin", async assert => {
|
||||
await visit("/g/discourse/manage/categories");
|
||||
|
||||
assert.ok(
|
||||
find(".groups-notifications-form .category-selector").length === 4,
|
||||
"it should display category inputs"
|
||||
);
|
||||
});
|
||||
|
||||
QUnit.test("As a group owner", async assert => {
|
||||
updateCurrentUser({ moderator: false, admin: false });
|
||||
|
||||
await visit("/g/discourse/manage/categories");
|
||||
|
||||
assert.ok(
|
||||
find(".groups-notifications-form .category-selector").length === 4,
|
||||
"it should display category inputs"
|
||||
);
|
||||
});
|
||||
33
test/javascripts/acceptance/group-manage-tags-test.js
Normal file
33
test/javascripts/acceptance/group-manage-tags-test.js
Normal file
@@ -0,0 +1,33 @@
|
||||
import { acceptance, updateCurrentUser } from "helpers/qunit-helpers";
|
||||
|
||||
acceptance("Managing Group Tag Notification Defaults");
|
||||
QUnit.test("As an anonymous user", async assert => {
|
||||
await visit("/g/discourse/manage/tags");
|
||||
|
||||
assert.ok(
|
||||
count(".group-members tr") > 0,
|
||||
"it should redirect to members page for an anonymous user"
|
||||
);
|
||||
});
|
||||
|
||||
acceptance("Managing Group Tag Notification Defaults", { loggedIn: true });
|
||||
|
||||
QUnit.test("As an admin", async assert => {
|
||||
await visit("/g/discourse/manage/tags");
|
||||
|
||||
assert.ok(
|
||||
find(".groups-notifications-form .tag-chooser").length === 4,
|
||||
"it should display tag inputs"
|
||||
);
|
||||
});
|
||||
|
||||
QUnit.test("As a group owner", async assert => {
|
||||
updateCurrentUser({ moderator: false, admin: false });
|
||||
|
||||
await visit("/g/discourse/manage/tags");
|
||||
|
||||
assert.ok(
|
||||
find(".groups-notifications-form .tag-chooser").length === 4,
|
||||
"it should display tag inputs"
|
||||
);
|
||||
});
|
||||
Reference in New Issue
Block a user