@@ -210,39 +210,6 @@ describe('CreateProjectModal', () => {
210210 expect ( onClose ) . not . toHaveBeenCalled ( ) ;
211211 } ) ;
212212
213- it ( 'does not call onProjectCreated or onClose when sendCommand returns undefined' , async ( ) => {
214- jest . mocked ( papi . commands . sendCommand ) . mockResolvedValue ( undefined ) ;
215- const onProjectCreated = jest . fn ( ) ;
216- const onClose = jest . fn ( ) ;
217- render (
218- < CreateProjectModal
219- projectId = { testProjectId }
220- onClose = { onClose }
221- onProjectCreated = { onProjectCreated }
222- /> ,
223- ) ;
224-
225- await userEvent . click ( screen . getByRole ( 'button' , { name : / ^ c r e a t e $ / i } ) ) ;
226-
227- await waitFor ( ( ) => expect ( papi . commands . sendCommand ) . toHaveBeenCalled ( ) ) ;
228- expect ( onProjectCreated ) . not . toHaveBeenCalled ( ) ;
229- expect ( onClose ) . not . toHaveBeenCalled ( ) ;
230- } ) ;
231-
232- it ( 'sends an error notification when sendCommand returns undefined' , async ( ) => {
233- jest . mocked ( papi . commands . sendCommand ) . mockResolvedValue ( undefined ) ;
234- render ( < CreateProjectModal projectId = { testProjectId } onClose = { jest . fn ( ) } /> ) ;
235-
236- await userEvent . click ( screen . getByRole ( 'button' , { name : / ^ c r e a t e $ / i } ) ) ;
237-
238- await waitFor ( ( ) =>
239- expect ( papi . notifications . send ) . toHaveBeenCalledWith ( {
240- message : '%interlinearizer_error_create_project_failed%' ,
241- severity : 'error' ,
242- } ) ,
243- ) ;
244- } ) ;
245-
246213 it ( 'defaults analysis language to ["und"] when the language input contains only whitespace' , async ( ) => {
247214 render ( < CreateProjectModal projectId = { testProjectId } onClose = { ( ) => { } } /> ) ;
248215
@@ -264,7 +231,7 @@ describe('CreateProjectModal', () => {
264231 } ) ;
265232
266233 it ( 'disables the create button while a submission is in progress' , async ( ) => {
267- let resolveCommand : ( value : undefined ) => void = ( ) => { } ;
234+ let resolveCommand : ( value : string ) => void = ( ) => { } ;
268235 jest . mocked ( papi . commands . sendCommand ) . mockImplementation (
269236 ( ) =>
270237 new Promise ( ( resolve ) => {
@@ -277,13 +244,13 @@ describe('CreateProjectModal', () => {
277244 await userEvent . click ( createButton ) ;
278245
279246 expect ( createButton ) . toBeDisabled ( ) ;
280- resolveCommand ( undefined ) ;
247+ resolveCommand ( 'not valid json{{{' ) ;
281248
282249 await waitFor ( ( ) => expect ( createButton ) . not . toBeDisabled ( ) ) ;
283250 } ) ;
284251
285252 it ( 'disables the cancel button while a submission is in progress' , async ( ) => {
286- let resolveCommand : ( value : undefined ) => void = ( ) => { } ;
253+ let resolveCommand : ( value : string ) => void = ( ) => { } ;
287254 jest . mocked ( papi . commands . sendCommand ) . mockImplementation (
288255 ( ) =>
289256 new Promise ( ( resolve ) => {
@@ -296,7 +263,7 @@ describe('CreateProjectModal', () => {
296263 await userEvent . click ( screen . getByRole ( 'button' , { name : / ^ c r e a t e $ / i } ) ) ;
297264
298265 expect ( cancelButton ) . toBeDisabled ( ) ;
299- resolveCommand ( undefined ) ;
266+ resolveCommand ( 'not valid json{{{' ) ;
300267
301268 await waitFor ( ( ) => expect ( cancelButton ) . not . toBeDisabled ( ) ) ;
302269 } ) ;
0 commit comments