File tree Expand file tree Collapse file tree
packages/devextreme/js/__internal/grids/grid_core/ai_chat Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -812,6 +812,25 @@ describe('AIChat', () => {
812812 expect ( mockClearChatButtonInstance . option ) . toHaveBeenCalledWith ( 'disabled' , false ) ;
813813 } ) ;
814814
815+ it ( 'should disable chat suggestions via chatInstance option' , ( ) => {
816+ const { aiChat } = createAIChat ( ) ;
817+ triggerContentTemplate ( ) ;
818+
819+ aiChat . setDisabled ( true ) ;
820+
821+ expect ( mockChatInstance . option ) . toHaveBeenCalledWith ( { suggestions : { disabled : true } } ) ;
822+ } ) ;
823+
824+ it ( 'should enable chat suggestions via chatInstance option when set to false' , ( ) => {
825+ const { aiChat } = createAIChat ( ) ;
826+ triggerContentTemplate ( ) ;
827+
828+ aiChat . setDisabled ( true ) ;
829+ aiChat . setDisabled ( false ) ;
830+
831+ expect ( mockChatInstance . option ) . toHaveBeenCalledWith ( { suggestions : { disabled : false } } ) ;
832+ } ) ;
833+
815834 it ( 'should not update when setting same disabled value' , ( ) => {
816835 const { aiChat } = createAIChat ( ) ;
817836 triggerContentTemplate ( ) ;
Original file line number Diff line number Diff line change @@ -273,6 +273,10 @@ export class AIChat {
273273 this . clearChatButtonInstance ?. option ( 'disabled' , disabled ) ;
274274 }
275275
276+ private setChatSuggestionsDisabled ( disabled : boolean ) : void {
277+ this . chatInstance ?. option ( { suggestions : { disabled } } ) ;
278+ }
279+
276280 public updateOptions ( options : AIChatOptions , updatePopup : boolean , updateChat : boolean ) : void {
277281 this . options = options ;
278282
@@ -308,6 +312,7 @@ export class AIChat {
308312 this . setTextAreaDisabled ( disabled ) ;
309313 this . setSpeechToTextDisabled ( disabled ) ;
310314 this . setClearChatButtonDisabled ( disabled ) ;
315+ this . setChatSuggestionsDisabled ( disabled ) ;
311316 }
312317
313318 public renderAIMessage ( message : AIMessage , container : HTMLElement ) : void {
You can’t perform that action at this time.
0 commit comments