File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ describe('Button Components', () => {
3030 button . toJSON ( ) ;
3131 } ) . not . toThrowError ( ) ;
3232
33- expect ( ( ) => new LinkButtonBuilder ( ) . setURL ( 'https://google.com' ) ) . not . toThrowError ( ) ;
33+ expect ( ( ) => new LinkButtonBuilder ( ) . setLabel ( 'label' ) . setURL ( 'https://google.com' ) . toJSON ( ) ) . not . toThrowError ( ) ;
3434 } ) ;
3535
3636 test ( 'GIVEN invalid fields THEN build does throw' , ( ) => {
@@ -61,6 +61,13 @@ describe('Button Components', () => {
6161 expect ( ( ) => new PrimaryButtonBuilder ( ) . setCustomId ( 'hi' ) . setDisabled ( 0 ) . toJSON ( ) ) . toThrowError ( ) ;
6262 // @ts -expect-error: Invalid emoji
6363 expect ( ( ) => new PrimaryButtonBuilder ( ) . setCustomId ( 'hi' ) . setEmoji ( 'foo' ) . toJSON ( ) ) . toThrowError ( ) ;
64+
65+ expect ( ( ) =>
66+ new LinkButtonBuilder ( )
67+ . setLabel ( 'label' )
68+ . setURL ( `https://google.com/${ 'a' . repeat ( 512 ) } ` )
69+ . toJSON ( ) ,
70+ ) . toThrowError ( ) ;
6471 } ) ;
6572
6673 test ( 'GiVEN valid input THEN valid JSON outputs are given' , ( ) => {
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ const buttonDangerPredicate = buttonCustomIdPredicateBase.extend({ style: z.lite
3232
3333const buttonLinkPredicate = buttonPredicateBase . extend ( {
3434 style : z . literal ( ButtonStyle . Link ) ,
35- url : z . url ( { protocol : / ^ (?: h t t p s ? | d i s c o r d ) $ / } ) ,
35+ url : z . url ( { protocol : / ^ (?: h t t p s ? | d i s c o r d ) $ / } ) . max ( 512 ) ,
3636 emoji : emojiPredicate . optional ( ) ,
3737 label : labelPredicate ,
3838} ) ;
You can’t perform that action at this time.
0 commit comments