feat(builder): add max min length in string option (#8214)

This commit is contained in:
Parbez
2022-07-08 00:15:32 +05:30
committed by GitHub
parent 10ba0080cc
commit 96c8d21f95
7 changed files with 51 additions and 10 deletions

View File

@@ -167,11 +167,13 @@ describe('Application Command toJSON() results', () => {
});
test('GIVEN a string option THEN calling toJSON should return a valid JSON', () => {
expect(getStringOption().toJSON()).toEqual<APIApplicationCommandStringOption>({
expect(getStringOption().setMinLength(1).setMaxLength(10).toJSON()).toEqual<APIApplicationCommandStringOption>({
name: 'owo',
description: 'Testing 123',
type: ApplicationCommandOptionType.String,
required: true,
max_length: 10,
min_length: 1,
});
expect(getStringOption().setAutocomplete(true).setChoices().toJSON()).toEqual<APIApplicationCommandStringOption>({