@@ -339,106 +339,5 @@ describe('ReviewCommentController', function () {
339339 assert . strictEqual ( Object . keys ( workspaceFileChangeCommentThreads ) [ 0 ] , fileName ) ;
340340 assert . strictEqual ( workspaceFileChangeCommentThreads [ fileName ] . length , 1 ) ;
341341 } ) ;
342-
343- it ( 'creates a file-scoped comment on an empty thread' , async function ( ) {
344- const fileName = 'data/products.json' ;
345- const uri = vscode . Uri . parse ( `${ repository . rootUri . toString ( ) } /${ fileName } ` ) ;
346- await activePullRequest . initializeReviewThreadCache ( ) ;
347- const localFileChanges = [ createLocalFileChange ( uri , fileName , repository . rootUri ) ] ;
348- const reviewModel = new ReviewModel ( ) ;
349- reviewModel . localFileChanges = localFileChanges ;
350- const reviewCommentController = new TestReviewCommentController (
351- reviewManager ,
352- manager ,
353- repository ,
354- reviewModel ,
355- gitApiImpl ,
356- telemetry
357- ) ;
358- const thread = createGHPRCommentThread ( 'review-1.2' , uri ) ;
359- thread . range = undefined as any ;
360-
361- sinon . stub ( activePullRequest , 'validateDraftMode' ) . returns ( Promise . resolve ( false ) ) ;
362- sinon . stub ( activePullRequest , 'getReviewThreads' ) . returns ( Promise . resolve ( [ ] ) ) ;
363- sinon . stub ( activePullRequest , 'getPendingReviewId' ) . returns ( Promise . resolve ( undefined ) ) ;
364-
365- sinon . stub ( manager , 'getCurrentUser' ) . returns ( Promise . resolve ( {
366- login : 'rmacfarlane' ,
367- url : 'https://github.com/rmacfarlane' ,
368- id : '123' ,
369- accountType : AccountType . User
370- } ) ) ;
371-
372- sinon . stub ( vscode . workspace , 'getWorkspaceFolder' ) . returns ( {
373- uri : repository . rootUri ,
374- name : '' ,
375- index : 0 ,
376- } ) ;
377-
378- sinon . stub ( vscode . workspace , 'asRelativePath' ) . callsFake ( ( pathOrUri : string | vscode . Uri ) : string => {
379- const path = pathOrUri . toString ( ) ;
380- return path . substring ( '/root/' . length ) ;
381- } ) ;
382-
383- sinon . stub ( repository , 'diffWith' ) . returns ( Promise . resolve ( '' ) ) ;
384-
385- await reviewCommentController . initialize ( ) ;
386-
387- githubRepo . queryProvider . expectGraphQLMutation (
388- {
389- mutation : schema . AddReviewThread ,
390- variables : {
391- input : {
392- path : fileName ,
393- body : 'file comment' ,
394- pullRequestId : activePullRequest . graphNodeId ,
395- pullRequestReviewId : undefined ,
396- startLine : undefined ,
397- line : undefined ,
398- side : 'RIGHT' ,
399- subjectType : 'FILE'
400- }
401- }
402- } ,
403- {
404- data : {
405- addPullRequestReviewThread : {
406- thread : {
407- id : 2 ,
408- isResolved : false ,
409- viewCanResolve : true ,
410- path : fileName ,
411- line : null ,
412- startLine : null ,
413- originalStartLine : null ,
414- originalLine : null ,
415- diffSide : 'RIGHT' ,
416- isOutdated : false ,
417- subjectType : 'FILE' ,
418- comments : {
419- nodes : [
420- {
421- databaseId : 2 ,
422- id : 2 ,
423- body : 'file comment' ,
424- commit : { } ,
425- diffHunk : '' ,
426- reactionGroups : [ ] ,
427- author : { }
428- }
429- ]
430- }
431- }
432- }
433- }
434- }
435- )
436-
437- const newReviewThreadPromise = asPromise ( activePullRequest . onDidChangeReviewThreads ) ;
438- await reviewCommentController . createOrReplyComment ( thread , 'file comment' , false ) ;
439- await newReviewThreadPromise ;
440- assert . strictEqual ( thread . comments . length , 1 ) ;
441- assert . strictEqual ( thread . comments [ 0 ] . parent , thread ) ;
442- } ) ;
443342 } ) ;
444343} ) ;
0 commit comments