@@ -2,7 +2,7 @@ import * as apputils from '@jupyterlab/apputils';
22import { nullTranslator } from '@jupyterlab/translation' ;
33import { JSONObject } from '@lumino/coreutils' ;
44import '@testing-library/jest-dom' ;
5- import { render , screen , waitFor } from '@testing-library/react' ;
5+ import { RenderResult , render , screen , waitFor } from '@testing-library/react' ;
66import userEvent from '@testing-library/user-event' ;
77import 'jest' ;
88import React from 'react' ;
@@ -108,6 +108,7 @@ describe('GitPanel', () => {
108108 describe ( '#commitFiles()' , ( ) => {
109109 let commitSpy : jest . SpyInstance < Promise < void > > ;
110110 let configSpy : jest . SpyInstance < Promise < void | JSONObject > > ;
111+ let renderResult : RenderResult ;
111112
112113 const commitSummary = 'Fix really stupid bug' ;
113114 const commitDescription = 'This will probably break everything :)' ;
@@ -181,7 +182,7 @@ describe('GitPanel', () => {
181182 props . model [ '_statusChanged' ] . emit ( props . model [ '_status' ] ) ;
182183 } ) ;
183184
184- render ( < GitPanel { ...props } /> ) ;
185+ renderResult = render ( < GitPanel { ...props } /> ) ;
185186 } ) ;
186187
187188 it ( 'should commit when commit message is provided' , async ( ) => {
@@ -223,6 +224,9 @@ describe('GitPanel', () => {
223224 it ( 'should prompt for user identity if explicitly configured' , async ( ) => {
224225 configSpy . mockResolvedValue ( { options : commitUser } ) ;
225226
227+ props . settings = MockSettings ( false , true ) as any ;
228+ renderResult . rerender ( < GitPanel { ...props } /> ) ;
229+
226230 mockUtils . showDialog . mockResolvedValue ( dialogValue ) ;
227231
228232 await userEvent . type ( screen . getAllByRole ( 'textbox' ) [ 0 ] , commitSummary ) ;
0 commit comments