@@ -5441,6 +5441,27 @@ describe("right-click Reply", () => {
54415441 expect ( target . text ) . toBe ( "x" . repeat ( 499 ) ) ;
54425442 } ) ;
54435443
5444+ it ( "keeps the native context menu for links inside a replyable bubble" , ( ) => {
5445+ const container = renderChatView ( { onSetReply : vi . fn ( ) } ) ;
5446+ const group = document . createElement ( "div" ) ;
5447+ group . className = "chat-group" ;
5448+ const bubble = document . createElement ( "div" ) ;
5449+ bubble . className = "chat-bubble" ;
5450+ bubble . dataset . messageText = "hello world" ;
5451+ const link = document . createElement ( "a" ) ;
5452+ link . href = "https://example.com" ;
5453+ link . textContent = "Example" ;
5454+ bubble . appendChild ( link ) ;
5455+ group . appendChild ( bubble ) ;
5456+ container . querySelector ( ".chat-thread-inner" ) ! . appendChild ( group ) ;
5457+
5458+ const evt = new MouseEvent ( "contextmenu" , { bubbles : true , cancelable : true } ) ;
5459+ link . dispatchEvent ( evt ) ;
5460+
5461+ expect ( evt . defaultPrevented ) . toBe ( false ) ;
5462+ expect ( document . querySelector ( ".chat-reply-context-menu" ) ) . toBeNull ( ) ;
5463+ } ) ;
5464+
54445465 it ( "keeps the native context menu when Reply is unavailable" , ( ) => {
54455466 const container = renderChatView ( ) ;
54465467 const section = container . querySelector < HTMLElement > ( ".card.chat" ) ;
0 commit comments