@@ -763,109 +763,6 @@ test.describe('Agent Detail Page', () => {
763763 } ) ;
764764 } ) ;
765765
766- test ( 'full JSON editor omits null condition fields from display' , async ( {
767- mockedPage,
768- } ) => {
769- const noisyCompositeControl : Control = {
770- id : 88 ,
771- name : 'Public Slack Mode' ,
772- control : {
773- description : 'Composite control with nullable transport fields' ,
774- enabled : true ,
775- execution : 'server' ,
776- scope : { step_types : [ 'tool' ] , stages : [ 'pre' ] } ,
777- condition : {
778- selector : null ,
779- evaluator : null ,
780- and : [
781- {
782- selector : null ,
783- evaluator : null ,
784- and : null ,
785- or : null ,
786- not : {
787- selector : { path : 'context.channel.scope' } ,
788- evaluator : {
789- name : 'list' ,
790- config : {
791- values : [ 'slack:direct:U123' ] ,
792- logic : 'any' ,
793- match_on : 'match' ,
794- } ,
795- } ,
796- and : null ,
797- or : null ,
798- not : null ,
799- } ,
800- } ,
801- {
802- selector : null ,
803- evaluator : null ,
804- and : null ,
805- or : [
806- {
807- selector : null ,
808- evaluator : null ,
809- and : null ,
810- or : null ,
811- not : {
812- selector : { path : 'name' } ,
813- evaluator : {
814- name : 'regex' ,
815- config : {
816- pattern : '(^|\\.)(read|memory_search|memory_get)$' ,
817- } ,
818- } ,
819- and : null ,
820- or : null ,
821- not : null ,
822- } ,
823- } ,
824- ] ,
825- not : null ,
826- } ,
827- ] ,
828- or : null ,
829- not : null ,
830- } ,
831- action : { decision : 'deny' } ,
832- tags : [ 'slack' , 'public' ] ,
833- } ,
834- } ;
835- const noisyControls : AgentControlsResponse = {
836- controls : [ noisyCompositeControl ] ,
837- } ;
838-
839- await mockRoutes . agent ( mockedPage , {
840- controls : { data : noisyControls } ,
841- } ) ;
842- await mockedPage . route ( '**/api/v1/controls/88/data' , async ( route ) => {
843- await route . fulfill ( {
844- status : 200 ,
845- contentType : 'application/json' ,
846- body : JSON . stringify ( { data : noisyCompositeControl . control } ) ,
847- } ) ;
848- } ) ;
849-
850- await mockedPage . goto (
851- getAgentControlsUrl ( { modal : 'edit' , controlId : 88 } )
852- ) ;
853-
854- const modal = mockedPage . getByRole ( 'dialog' , { name : 'Edit Control' } ) ;
855- await expect ( modal ) . toBeVisible ( ) ;
856- await modal . getByText ( 'Full JSON' , { exact : true } ) . click ( ) ;
857-
858- await expect ( modal ) . not . toContainText ( '"selector": null' ) ;
859- await expect ( modal ) . not . toContainText ( '"evaluator": null' ) ;
860- await expect ( modal ) . not . toContainText ( '"and": null' ) ;
861- await expect ( modal ) . not . toContainText ( '"or": null' ) ;
862- await expect ( modal ) . not . toContainText ( '"not": null' ) ;
863- await expect ( modal ) . toContainText ( '"context.channel.scope"' ) ;
864- await expect ( modal ) . toContainText (
865- '"(^|\\\\.)(read|memory_search|memory_get)$"'
866- ) ;
867- } ) ;
868-
869766 test ( 'disables Form switch when JSON is invalid' , async ( { mockedPage } ) => {
870767 await mockedPage . goto ( agentUrl ) ;
871768
0 commit comments