Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
  • Loading branch information
t3chguy committed Oct 13, 2023
1 parent bf311cf commit 6f87d3e
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion test/SlashCommands-test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down Expand Up @@ -88,7 +89,6 @@ describe("SlashCommands", () => {
});

describe.each([
["upgraderoom"],
["myroomnick"],
["roomavatar"],
["myroomavatar"],
Expand Down Expand Up @@ -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")!;
Expand Down

0 comments on commit 6f87d3e

Please sign in to comment.