fix(selectMenu): allow json to be used for select menu options (#8322)

This commit is contained in:
Suneet Tipirneni
2022-07-24 09:14:33 -04:00
committed by GitHub
parent 335695c698
commit 6a2d0d8e96
3 changed files with 25 additions and 14 deletions

View File

@@ -149,6 +149,17 @@ describe('Select Menu Components', () => {
}).toThrowError();
});
test('GIVEN valid option types THEN does not throw', () => {
expect(() =>
selectMenu().addOptions({
label: 'test',
value: 'test',
}),
).not.toThrowError();
expect(() => selectMenu().addOptions(selectMenuOption().setLabel('test').setValue('test'))).not.toThrowError();
});
test('GIVEN valid JSON input THEN valid JSON history is correct', () => {
expect(
new SelectMenuBuilder(selectMenuDataWithoutOptions)