FEATURE: Allow group moderators to close/archive topics
* FEATURE: Allow group moderators to close/archive topics
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import { acceptance, updateCurrentUser } from "helpers/qunit-helpers";
|
||||
|
||||
acceptance("Topic - Admin Menu Anonymous Users", { loggedIn: false });
|
||||
|
||||
QUnit.test("Enter as a regular user", async assert => {
|
||||
await visit("/t/internationalization-localization/280");
|
||||
assert.ok(exists("#topic"), "The topic was rendered");
|
||||
assert.ok(!exists(".toggle-admin-menu"), "The admin menu button was not rendered");
|
||||
});
|
||||
|
||||
|
||||
acceptance("Topic - Admin Menu", { loggedIn: true });
|
||||
|
||||
QUnit.test("Enter as a user with group moderator permissions", async assert => {
|
||||
updateCurrentUser({ moderator: false, admin: false, trust_level: 1 });
|
||||
|
||||
await visit("/t/topic-for-group-moderators/2480");
|
||||
assert.ok(exists("#topic"), "The topic was rendered");
|
||||
assert.ok(exists(".toggle-admin-menu"), "The admin menu button was rendered");
|
||||
});
|
||||
|
||||
QUnit.test("Enter as a user with group moderator permissions", async assert => {
|
||||
updateCurrentUser({ moderator: true, admin: true, trust_level: 4 });
|
||||
|
||||
await visit("/t/topic-for-group-moderators/2480");
|
||||
assert.ok(exists("#topic"), "The topic was rendered");
|
||||
assert.ok(exists(".toggle-admin-menu"), "The admin menu button was rendered");
|
||||
});
|
||||
@@ -273,7 +273,7 @@ QUnit.test(
|
||||
updateCurrentUser({ moderator: true, canManageTopic: true });
|
||||
const futureDateInputSelector = selectKit(".future-date-input-selector");
|
||||
|
||||
await visit("/t/internationalization-localization");
|
||||
await visit("/t/topic-for-group-moderators/2480");
|
||||
await click(".toggle-admin-menu");
|
||||
await click(".topic-admin-status-update button");
|
||||
await futureDateInputSelector.expand();
|
||||
|
||||
@@ -255,6 +255,14 @@ export function applyDefaultHandlers(pretender) {
|
||||
pretender.get("/t/12.json", () => response(fixturesByUrl["/t/12/1.json"]));
|
||||
pretender.put("/t/1234/re-pin", success);
|
||||
|
||||
pretender.get("/t/2480.json", () => {
|
||||
const json = fixturesByUrl["/t/34/1.json"];
|
||||
json.details.can_archive_topic = true;
|
||||
json.details.can_close_topic = true;
|
||||
|
||||
return response(json);
|
||||
});
|
||||
|
||||
pretender.get("/t/id_for/:slug", () => {
|
||||
return response({
|
||||
id: 280,
|
||||
|
||||
Reference in New Issue
Block a user