@@ -6,6 +6,9 @@ const selectMenu = () => new StringSelectMenuBuilder();
66const selectMenuOption = ( ) => new StringSelectMenuOptionBuilder ( ) ;
77
88const longStr = 'a' . repeat ( 256 ) ;
9+ const selectMenuOptionLabelAboveLimit = 'a' . repeat ( 101 ) ;
10+ const selectMenuOptionValueAboveLimit = 'a' . repeat ( 101 ) ;
11+ const selectMenuOptionDescriptionAboveLimit = 'a' . repeat ( 101 ) ;
912
1013const selectMenuOptionData : APISelectMenuOption = {
1114 label : 'test' ,
@@ -53,12 +56,12 @@ describe('Select Menu Components', () => {
5356 expect ( ( ) => selectMenu ( ) . setDisabled ( ) ) . not . toThrowError ( ) ;
5457 expect ( ( ) => selectMenu ( ) . setPlaceholder ( 'description' ) ) . not . toThrowError ( ) ;
5558 const option = selectMenuOption ( )
56- . setLabel ( 'test' )
59+ . setLabel ( 'a' . repeat ( 100 ) )
5760 . setValue ( 'test' )
5861 . setDefault ( true )
5962 . setEmoji ( { name : 'test' } )
6063 . setDescription ( 'description' ) ;
61- expect ( ( ) => selectMenu ( ) . addOptions ( option ) ) . not . toThrowError ( ) ;
64+ expect ( ( ) => selectMenu ( ) . setCustomId ( 'customId' ) . addOptions ( option ) . toJSON ( ) ) . not . toThrowError ( ) ;
6265 expect ( ( ) => selectMenu ( ) . setOptions ( option ) ) . not . toThrowError ( ) ;
6366 expect ( ( ) => selectMenu ( ) . setOptions ( { label : 'test' , value : 'test' } ) ) . not . toThrowError ( ) ;
6467 expect ( ( ) => selectMenu ( ) . addOptions ( [ option ] ) ) . not . toThrowError ( ) ;
@@ -156,13 +159,13 @@ describe('Select Menu Components', () => {
156159
157160 expect ( ( ) => {
158161 selectMenuOption ( )
159- . setLabel ( longStr )
160- . setValue ( longStr )
162+ . setLabel ( selectMenuOptionLabelAboveLimit )
163+ . setValue ( selectMenuOptionValueAboveLimit )
161164 // @ts -expect-error: Invalid default value
162165 . setDefault ( - 1 )
163166 // @ts -expect-error: Invalid emoji
164167 . setEmoji ( { name : 1 } )
165- . setDescription ( longStr ) ;
168+ . setDescription ( selectMenuOptionDescriptionAboveLimit ) ;
166169 } ) . toThrowError ( ) ;
167170 } ) ;
168171
0 commit comments