You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-07-28 15:22:05 +03:00
Disable upgraderoom command without developer mode enabled (#11744)
* Disable upgraderoom command without developer mode enabled Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * Update tests Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --------- Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
committed by
GitHub
parent
bdf2ebd301
commit
255f0f59f5
@ -28,6 +28,7 @@ import WidgetUtils from "../src/utils/WidgetUtils";
|
||||
import { WidgetType } from "../src/widgets/WidgetType";
|
||||
import { warnSelfDemote } from "../src/components/views/right_panel/UserInfo";
|
||||
import dispatcher from "../src/dispatcher/dispatcher";
|
||||
import { SettingLevel } from "../src/settings/SettingLevel";
|
||||
|
||||
jest.mock("../src/components/views/right_panel/UserInfo");
|
||||
|
||||
@ -88,7 +89,6 @@ describe("SlashCommands", () => {
|
||||
});
|
||||
|
||||
describe.each([
|
||||
["upgraderoom"],
|
||||
["myroomnick"],
|
||||
["roomavatar"],
|
||||
["myroomavatar"],
|
||||
@ -126,6 +126,22 @@ describe("SlashCommands", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("/upgraderoom", () => {
|
||||
beforeEach(() => {
|
||||
command = findCommand("upgraderoom")!;
|
||||
setCurrentRoom();
|
||||
});
|
||||
|
||||
it("should be disabled by default", () => {
|
||||
expect(command.isEnabled(client)).toBe(false);
|
||||
});
|
||||
|
||||
it("should be enabled for developerMode", () => {
|
||||
SettingsStore.setValue("developerMode", null, SettingLevel.DEVICE, true);
|
||||
expect(command.isEnabled(client)).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
describe("/op", () => {
|
||||
beforeEach(() => {
|
||||
command = findCommand("op")!;
|
||||
|
Reference in New Issue
Block a user