File tree Expand file tree Collapse file tree 2 files changed +31
-1
lines changed Expand file tree Collapse file tree 2 files changed +31
-1
lines changed Original file line number Diff line number Diff line change @@ -109,5 +109,35 @@ describe('Plugin Schema Test', () => {
109109 // check if plugin list is empty
110110 cy . get ( domSelector . empty ) . should ( 'be.visible' ) ;
111111 } ) ;
112+
113+ it ( 'click plugin Edit button the existing configuration should display' , ( ) => {
114+ cy . visit ( '/' ) ;
115+ cy . contains ( 'Consumer' ) . click ( ) ;
116+ cy . get ( '.ant-empty-normal' ) . should ( 'be.visible' ) ;
117+ cy . contains ( 'Create' ) . click ( ) ;
118+
119+ cy . get ( '#username' ) . type ( 'test' ) ;
120+ cy . contains ( 'Next' ) . click ( ) ;
121+ cy . contains ( '.ant-card' , 'client-control' ) . within ( ( ) => {
122+ cy . contains ( 'Enable' ) . click ( {
123+ force : true ,
124+ } ) ;
125+ } ) ;
126+ cy . focused ( '.ant-drawer-content' ) . should ( 'exist' ) ;
127+ cy . get ( '.view-zones' ) . should ( 'exist' ) ;
128+ cy . contains ( 'max_body_size' ) . should ( 'be.visible' ) ;
129+ cy . window ( ) . then ( ( window ) => {
130+ window . monacoEditor . setValue ( JSON . stringify ( { max_body_size : 1024 } ) ) ;
131+ cy . contains ( 'button' , 'Submit' ) . click ( ) ;
132+ } ) ;
133+ cy . wait ( 3000 ) ;
134+ cy . contains ( '.ant-card' , 'client-control' ) . within ( ( ) => {
135+ cy . contains ( 'Enable' ) . click ( {
136+ force : true ,
137+ } ) ;
138+ } ) ;
139+ cy . focused ( '.ant-drawer-content' ) . should ( 'exist' ) ;
140+ cy . contains ( '1024' ) . should ( 'be.visible' ) ;
141+ } ) ;
112142 } ) ;
113143} ) ;
Original file line number Diff line number Diff line change @@ -490,7 +490,7 @@ const PluginDetail: React.FC<Props> = ({
490490 // NOTE: for debug & test
491491 // @ts -ignore
492492 window . monacoEditor = editor ;
493- if ( targetModel ) editor . setValue ( targetModelCode ) ;
493+ if ( targetModel && content === '{}' ) editor . setValue ( targetModelCode ) ;
494494 } }
495495 options = { {
496496 scrollbar : {
You can’t perform that action at this time.
0 commit comments