@@ -41,15 +41,20 @@ const mockedResponses: {
41
41
* @private
42
42
* @returns mock settings
43
43
*/
44
- function MockSettings ( commitAndPush = true , promptUserIdentity = false ) {
44
+ function MockSettings (
45
+ commitAndPush = true ,
46
+ promptUserIdentity = false ,
47
+ simpleStaging = false
48
+ ) {
45
49
return {
46
50
changed : {
47
51
connect : ( ) => true ,
48
52
disconnect : ( ) => true
49
53
} ,
50
54
composite : {
51
55
commitAndPush,
52
- promptUserIdentity
56
+ promptUserIdentity,
57
+ simpleStaging
53
58
}
54
59
} ;
55
60
}
@@ -151,8 +156,6 @@ describe('GitPanel', () => {
151
156
beforeEach ( ( ) => {
152
157
configSpy = props . model . config = jest . fn ( ) ;
153
158
commitSpy = props . model . commit = jest . fn ( ) ;
154
- // @ts -expect-error turn off set status
155
- props . model . _setStatus = jest . fn ( ) ;
156
159
157
160
// @ts -expect-error set a private prop
158
161
props . model . _status = {
@@ -173,10 +176,15 @@ describe('GitPanel', () => {
173
176
state : 0
174
177
} ;
175
178
179
+ // @ts -expect-error turn off set status
180
+ props . model . _setStatus = jest . fn ( ( ) => {
181
+ props . model . _statusChanged . emit ( props . model . _status ) ;
182
+ } ) ;
183
+
176
184
render ( < GitPanel { ...props } /> ) ;
177
185
} ) ;
178
186
179
- it . skip ( 'should commit when commit message is provided' , async ( ) => {
187
+ it ( 'should commit when commit message is provided' , async ( ) => {
180
188
configSpy . mockResolvedValue ( { options : commitUser } ) ;
181
189
182
190
await userEvent . type ( screen . getAllByRole ( 'textbox' ) [ 0 ] , commitSummary ) ;
@@ -212,16 +220,15 @@ describe('GitPanel', () => {
212
220
expect ( commitSpy ) . not . toHaveBeenCalled ( ) ;
213
221
} ) ;
214
222
215
- it . skip ( 'should prompt for user identity if explicitly configured' , async ( ) => {
223
+ it ( 'should prompt for user identity if explicitly configured' , async ( ) => {
216
224
configSpy . mockResolvedValue ( { options : commitUser } ) ;
217
225
218
- props . settings = MockSettings ( false , true ) as any ;
219
- render ( < GitPanel { ...props } /> ) ;
220
-
221
226
mockUtils . showDialog . mockResolvedValue ( dialogValue ) ;
222
227
223
228
await userEvent . type ( screen . getAllByRole ( 'textbox' ) [ 0 ] , commitSummary ) ;
224
- await userEvent . click ( screen . getByRole ( 'button' , { name : 'Commit' } ) ) ;
229
+ await userEvent . click (
230
+ screen . getAllByRole ( 'button' , { name : 'Commit' } ) [ 0 ]
231
+ ) ;
225
232
226
233
expect ( configSpy ) . toHaveBeenCalledTimes ( 1 ) ;
227
234
expect ( configSpy . mock . calls [ 0 ] ) . toHaveLength ( 0 ) ;
@@ -231,7 +238,7 @@ describe('GitPanel', () => {
231
238
expect ( commitSpy ) . toHaveBeenCalledWith ( commitSummary , false , author ) ;
232
239
} ) ;
233
240
234
- it . skip ( 'should prompt for user identity if user.name is not set' , async ( ) => {
241
+ it ( 'should prompt for user identity if user.name is not set' , async ( ) => {
235
242
configSpy . mockImplementation ( mockConfigImplementation ( 'user.email' ) ) ;
236
243
mockUtils . showDialog . mockResolvedValue ( dialogValue ) ;
237
244
@@ -247,7 +254,7 @@ describe('GitPanel', () => {
247
254
expect ( commitSpy ) . toHaveBeenCalledWith ( commitSummary , false , null ) ;
248
255
} ) ;
249
256
250
- it . skip ( 'should prompt for user identity if user.email is not set' , async ( ) => {
257
+ it ( 'should prompt for user identity if user.email is not set' , async ( ) => {
251
258
configSpy . mockImplementation ( mockConfigImplementation ( 'user.name' ) ) ;
252
259
mockUtils . showDialog . mockResolvedValue ( dialogValue ) ;
253
260
@@ -263,7 +270,7 @@ describe('GitPanel', () => {
263
270
expect ( commitSpy ) . toHaveBeenCalledWith ( commitSummary , false , null ) ;
264
271
} ) ;
265
272
266
- it . skip ( 'should not commit if no user identity is set and the user rejects the dialog' , async ( ) => {
273
+ it ( 'should not commit if no user identity is set and the user rejects the dialog' , async ( ) => {
267
274
configSpy . mockResolvedValue ( { options : { } } ) ;
268
275
mockUtils . showDialog . mockResolvedValue ( {
269
276
button : {
0 commit comments