Create timeout command #302
2 changed files with 8 additions and 8 deletions
|
@ -1,7 +1,7 @@
|
||||||
import { CacheType, CommandInteraction, EmbedBuilder, GuildMember, PermissionsBitField, SlashCommandBuilder, TextChannel } from "discord.js";
|
import { CacheType, CommandInteraction, EmbedBuilder, GuildMember, PermissionsBitField, SlashCommandBuilder, TextChannel } from "discord.js";
|
||||||
import { AuditType } from "../constants/AuditType";
|
import { AuditType } from "../constants/AuditType";
|
||||||
import EmbedColours from "../constants/EmbedColours";
|
import EmbedColours from "../constants/EmbedColours";
|
||||||
import Audit from "../entity/Audit";
|
import Audit from "../database/entities/Audit";
|
||||||
import SettingsHelper from "../helpers/SettingsHelper";
|
import SettingsHelper from "../helpers/SettingsHelper";
|
||||||
import TimeLengthInput from "../helpers/TimeLengthInput";
|
import TimeLengthInput from "../helpers/TimeLengthInput";
|
||||||
import { Command } from "../type/command";
|
import { Command } from "../type/command";
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { APIEmbed, CacheType, CommandInteraction, CommandInteractionOption, DMCh
|
||||||
import { mock } from "jest-mock-extended";
|
import { mock } from "jest-mock-extended";
|
||||||
import Timeout from "../../src/commands/timeout";
|
import Timeout from "../../src/commands/timeout";
|
||||||
import SettingsHelper from "../../src/helpers/SettingsHelper";
|
import SettingsHelper from "../../src/helpers/SettingsHelper";
|
||||||
import Audit from "../../src/entity/Audit";
|
import Audit from "../../src/database/entities/Audit";
|
||||||
import EmbedColours from "../../src/constants/EmbedColours";
|
import EmbedColours from "../../src/constants/EmbedColours";
|
||||||
import { DeepPartial, EntityTarget } from "typeorm";
|
import { DeepPartial, EntityTarget } from "typeorm";
|
||||||
import BaseEntity from "../../src/contracts/BaseEntity";
|
import BaseEntity from "../../src/contracts/BaseEntity";
|
||||||
|
@ -468,9 +468,9 @@ describe('execute', () => {
|
||||||
}
|
}
|
||||||
} as unknown as CommandInteraction;
|
} as unknown as CommandInteraction;
|
||||||
|
|
||||||
|
|
||||||
await command.execute(interaction);
|
await command.execute(interaction);
|
||||||
|
|
||||||
expect(timeoutFunc).toBeCalledWith(1000 * 60 * 1, "");
|
expect(timeoutFunc).toBeCalledWith(1000 * 60 * 1, "");
|
||||||
expect(savedAudit?.Reason).toBe("*none*");
|
expect(savedAudit?.Reason).toBe("*none*");
|
||||||
|
|
||||||
|
@ -551,9 +551,9 @@ describe('execute', () => {
|
||||||
}
|
}
|
||||||
} as unknown as CommandInteraction;
|
} as unknown as CommandInteraction;
|
||||||
|
|
||||||
|
|
||||||
await command.execute(interaction);
|
await command.execute(interaction);
|
||||||
|
|
||||||
expect(timeoutFunc).toBeCalled();
|
expect(timeoutFunc).toBeCalled();
|
||||||
expect(sentEmbeds.length).toBe(0);
|
expect(sentEmbeds.length).toBe(0);
|
||||||
expect(logChannelSendFunc).not.toBeCalled();
|
expect(logChannelSendFunc).not.toBeCalled();
|
||||||
|
@ -625,9 +625,9 @@ describe('execute', () => {
|
||||||
}
|
}
|
||||||
} as unknown as CommandInteraction;
|
} as unknown as CommandInteraction;
|
||||||
|
|
||||||
|
|
||||||
await command.execute(interaction);
|
await command.execute(interaction);
|
||||||
|
|
||||||
expect(timeoutFunc).toBeCalled();
|
expect(timeoutFunc).toBeCalled();
|
||||||
expect(sentEmbeds.length).toBeGreaterThan(0);
|
expect(sentEmbeds.length).toBeGreaterThan(0);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue