mirror of
https://github.com/darksaid98/cadence-discord-bot.git
synced 2026-12-03 14:38:49 +00:00
update tests folder structure to match files tested
This commit is contained in:
1 parent
374c85f9a7
commit
a7aefd085f
2 files changed
+3
-3
No files matched your search
@@ -0,0 +1,38 @@
|
||||
import helpCommand from '../../../interactions/slashcommands/help';
|
||||
import { SlashCommandNumberOption } from 'discord.js';
|
||||
import { BaseSlashCommandInteraction } from '../../../common/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('');
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user