@@ -2,7 +2,7 @@ import * as apputils from '@jupyterlab/apputils';
2
2
import { nullTranslator } from '@jupyterlab/translation' ;
3
3
import { JSONObject } from '@lumino/coreutils' ;
4
4
import '@testing-library/jest-dom' ;
5
- import { render , screen , waitFor } from '@testing-library/react' ;
5
+ import { RenderResult , render , screen , waitFor } from '@testing-library/react' ;
6
6
import userEvent from '@testing-library/user-event' ;
7
7
import 'jest' ;
8
8
import React from 'react' ;
@@ -108,6 +108,7 @@ describe('GitPanel', () => {
108
108
describe ( '#commitFiles()' , ( ) => {
109
109
let commitSpy : jest . SpyInstance < Promise < void > > ;
110
110
let configSpy : jest . SpyInstance < Promise < void | JSONObject > > ;
111
+ let renderResult : RenderResult ;
111
112
112
113
const commitSummary = 'Fix really stupid bug' ;
113
114
const commitDescription = 'This will probably break everything :)' ;
@@ -181,7 +182,7 @@ describe('GitPanel', () => {
181
182
props . model [ '_statusChanged' ] . emit ( props . model [ '_status' ] ) ;
182
183
} ) ;
183
184
184
- render ( < GitPanel { ...props } /> ) ;
185
+ renderResult = render ( < GitPanel { ...props } /> ) ;
185
186
} ) ;
186
187
187
188
it ( 'should commit when commit message is provided' , async ( ) => {
@@ -223,6 +224,9 @@ describe('GitPanel', () => {
223
224
it ( 'should prompt for user identity if explicitly configured' , async ( ) => {
224
225
configSpy . mockResolvedValue ( { options : commitUser } ) ;
225
226
227
+ props . settings = MockSettings ( false , true ) as any ;
228
+ renderResult . rerender ( < GitPanel { ...props } /> ) ;
229
+
226
230
mockUtils . showDialog . mockResolvedValue ( dialogValue ) ;
227
231
228
232
await userEvent . type ( screen . getAllByRole ( 'textbox' ) [ 0 ] , commitSummary ) ;
0 commit comments