mirror of
https://github.com/discourse/discourse.git
synced 2024-11-29 10:55:25 +08:00
06073fe8c6
* FEATURE: Allow group moderators to close/archive topics
29 lines
1.1 KiB
JavaScript
29 lines
1.1 KiB
JavaScript
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");
|
|
});
|