@@ -210,7 +210,7 @@ describe('CreateProjectModal', () => {
210210 expect ( onClose ) . not . toHaveBeenCalled ( ) ;
211211 } ) ;
212212
213- it ( 'does not call onProjectCreated, onClose, or send a notification when sendCommand returns undefined' , async ( ) => {
213+ it ( 'does not call onProjectCreated or onClose when sendCommand returns undefined' , async ( ) => {
214214 jest . mocked ( papi . commands . sendCommand ) . mockResolvedValue ( undefined ) ;
215215 const onProjectCreated = jest . fn ( ) ;
216216 const onClose = jest . fn ( ) ;
@@ -227,7 +227,20 @@ describe('CreateProjectModal', () => {
227227 await waitFor ( ( ) => expect ( papi . commands . sendCommand ) . toHaveBeenCalled ( ) ) ;
228228 expect ( onProjectCreated ) . not . toHaveBeenCalled ( ) ;
229229 expect ( onClose ) . not . toHaveBeenCalled ( ) ;
230- expect ( papi . notifications . send ) . 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+ ) ;
231244 } ) ;
232245
233246 it ( 'defaults analysis language to ["und"] when the language input contains only whitespace' , async ( ) => {
0 commit comments