2020-08-07 00:27:27 +08:00
|
|
|
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(
|
2020-08-14 05:20:23 +08:00
|
|
|
find(".groups-notifications-form .category-selector").length === 5,
|
2020-08-07 00:27:27 +08:00
|
|
|
"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(
|
2020-08-14 05:20:23 +08:00
|
|
|
find(".groups-notifications-form .category-selector").length === 5,
|
2020-08-07 00:27:27 +08:00
|
|
|
"it should display category inputs"
|
|
|
|
);
|
|
|
|
});
|