@@ -235,6 +235,21 @@ describe('GitHubFile', function () {
235
235
} )
236
236
} )
237
237
238
+ describe ( 'when the file is part of a GitHub wiki' , ( ) => {
239
+ let fixtureName = 'github-remote-wiki'
240
+
241
+ beforeEach ( async ( ) => {
242
+ setupWorkingDir ( fixtureName )
243
+ await setupGithubFile ( )
244
+ } )
245
+
246
+ it ( 'opens the GitHub.com wiki URL for the file and behaves exactly like open' , ( ) => {
247
+ spyOn ( githubFile , 'openURLInBrowser' )
248
+ githubFile . openOnMaster ( )
249
+ expect ( githubFile . openURLInBrowser ) . toHaveBeenCalledWith ( 'https://github.com/some-user/some-repo/wiki/some-file' )
250
+ } )
251
+ } )
252
+
238
253
describe ( 'when the file is part of a GitHub gist' , ( ) => {
239
254
let fixtureName = 'github-remote-gist'
240
255
@@ -340,6 +355,21 @@ describe('GitHubFile', function () {
340
355
} )
341
356
} )
342
357
358
+ describe ( 'when the file is part of a GitHub wiki' , ( ) => {
359
+ let fixtureName = 'github-remote-wiki'
360
+
361
+ beforeEach ( async ( ) => {
362
+ setupWorkingDir ( fixtureName )
363
+ await setupGithubFile ( )
364
+ } )
365
+
366
+ it ( 'opens the GitHub.com wiki history URL for the file' , ( ) => {
367
+ spyOn ( githubFile , 'openURLInBrowser' )
368
+ githubFile . history ( )
369
+ expect ( githubFile . openURLInBrowser ) . toHaveBeenCalledWith ( 'https://github.com/some-user/some-repo/wiki/some-file/_history' )
370
+ } )
371
+ } )
372
+
343
373
describe ( 'when the file is part of a GitHub gist' , ( ) => {
344
374
let fixtureName = 'github-remote-gist'
345
375
@@ -381,6 +411,21 @@ describe('GitHubFile', function () {
381
411
} )
382
412
} )
383
413
414
+ describe ( 'when the file is part of a GitHub wiki' , ( ) => {
415
+ let fixtureName = 'github-remote-wiki'
416
+
417
+ beforeEach ( async ( ) => {
418
+ setupWorkingDir ( fixtureName )
419
+ atom . config . set ( 'open-on-github.includeLineNumbersInUrls' , true )
420
+ await setupGithubFile ( )
421
+ } )
422
+
423
+ it ( 'copies the GitHub.com wiki URL to the clipboard and ignores any selection ranges' , ( ) => {
424
+ githubFile . copyURL ( [ [ 0 , 0 ] , [ 1 , 1 ] ] )
425
+ expect ( atom . clipboard . read ( ) ) . toBe ( 'https://github.com/some-user/some-repo/wiki/some-file/80b7897ceb6bd7531708509b50afeab36a4b73fd' )
426
+ } )
427
+ } )
428
+
384
429
describe ( 'when the file is part of a GitHub gist' , ( ) => {
385
430
let fixtureName = 'github-remote-gist'
386
431
@@ -422,6 +467,21 @@ describe('GitHubFile', function () {
422
467
} )
423
468
} )
424
469
470
+ describe ( 'when the file is part of a GitHub wiki' , ( ) => {
471
+ let fixtureName = 'github-remote-wiki'
472
+
473
+ beforeEach ( async ( ) => {
474
+ setupWorkingDir ( fixtureName )
475
+ await setupGithubFile ( )
476
+ } )
477
+
478
+ it ( 'opens the GitHub.com wiki history URL for the file' , ( ) => {
479
+ spyOn ( githubFile , 'openURLInBrowser' )
480
+ githubFile . openRepository ( )
481
+ expect ( githubFile . openURLInBrowser ) . toHaveBeenCalledWith ( 'https://github.com/some-user/some-repo/wiki' )
482
+ } )
483
+ } )
484
+
425
485
describe ( 'when the file is part of a GitHub gist' , ( ) => {
426
486
let fixtureName = 'github-remote-gist'
427
487
0 commit comments