File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -132,13 +132,18 @@ describe('Tasks - TSM', () => {
132132
133133 cy . focused ( )
134134
135- cy . getByTestID ( 'flux-editor' ) . monacoType ( `option task = {
135+ cy . getByTestID ( 'flux-editor' )
136+ . monacoType (
137+ `option task = {
136138 name: "Option Test",
137139 every: 24h,
138140 offset: 20m
139141 }
140142 from(bucket: "defbuck")
141- |> range(start: -2m)` )
143+ |> range(start: -2m)`
144+ )
145+ // Fix bug with monaco error inserting an extra } here.
146+ . monacoType ( '{backSpace}' )
142147
143148 cy . getByTestID ( 'task-form-name' )
144149 . click ( )
Original file line number Diff line number Diff line change @@ -145,7 +145,9 @@ class TaskPage extends PureComponent<Props> {
145145 // if the script has a pre-defined option task = {}
146146 // we want the taskOptions to take precedence over what is provided in the script
147147 // currently we delete that part of the script
148- script = script . replace ( new RegExp ( 'option\\s+task\\s+=\\s+{(.|\\s)*}' ) , '' )
148+
149+ const removeTaskOptionsRegex = / o p t i o n \s + t a s k \s + = \s + { ( \s | \S ) * ?} /
150+ script = script . replace ( removeTaskOptionsRegex , '' )
149151
150152 if ( ! isValidFlux ( script ) ) {
151153 this . props . invalidFlux ( )
You can’t perform that action at this time.
0 commit comments