mirror of
https://github.com/darksaid98/cadence-discord-bot.git
synced 2026-12-01 22:14:59 +00:00
39 lines
1.3 KiB
TypeScript
39 lines
1.3 KiB
TypeScript
import helpCommand from '../interactions/commands/info/help';
|
|
import { SlashCommandNumberOption } from 'discord.js';
|
|
import { BaseSlashCommandInteraction } from '../classes/interactions';
|
|
|
|
describe('HelpCommand', () => {
|
|
describe('getCommandParams', () => {
|
|
it('should return the correct command params', () => {
|
|
const command = {
|
|
data: {
|
|
options: [
|
|
new SlashCommandNumberOption()
|
|
.setName('optionname')
|
|
.setDescription('optionDescription')
|
|
.setRequired(true)
|
|
]
|
|
}
|
|
} as unknown as BaseSlashCommandInteraction;
|
|
|
|
const locale = 'en-US';
|
|
const commandParams = helpCommand['getCommandParams'](command, locale);
|
|
|
|
expect(commandParams).toBe('**`optionname`** ');
|
|
});
|
|
|
|
it('should return an empty string when no options are present', () => {
|
|
const command = {
|
|
data: {
|
|
options: []
|
|
}
|
|
} as unknown as BaseSlashCommandInteraction;
|
|
|
|
const locale = 'en-US';
|
|
const commandParams = helpCommand['getCommandParams'](command, locale);
|
|
|
|
expect(commandParams).toBe('');
|
|
});
|
|
});
|
|
});
|