@@ -2584,6 +2584,66 @@ jobs:
25842584 } ) ;
25852585 } ) ;
25862586
2587+ it ( 'decorates a scm uri associated with a private repo' , ( ) => {
2588+ const scmUri = 'github.com:102498:boat!"#$%&\'()-=|@`{;+]},<.>/ 🚗' ;
2589+
2590+ githubMock . request . resolves ( {
2591+ data : {
2592+ full_name : 'iAm/theCaptain' ,
2593+ private : true ,
2594+ visibility : 'private'
2595+ }
2596+ } ) ;
2597+
2598+ return scm
2599+ . decorateUrl ( {
2600+ scmUri,
2601+ token : 'mytokenfortesting'
2602+ } )
2603+ . then ( data => {
2604+ assert . deepEqual ( data , {
2605+ branch : 'boat!"#$%&\'()-=|@`{;+]},<.>/ 🚗' ,
2606+ name : 'iAm/theCaptain' ,
2607+ url : `https://github.com/iAm/theCaptain/tree/${ encodeURIComponent (
2608+ 'boat!"#$%&\'()-=|@`{;+]},<.>/ 🚗'
2609+ ) } `,
2610+ rootDir : '' ,
2611+ private : true
2612+ } ) ;
2613+ assert . calledWith ( githubMock . request , 'GET /repositories/:id' , { id : '102498' } ) ;
2614+ } ) ;
2615+ } ) ;
2616+
2617+ it ( 'decorates a scm uri associated with an internal repo' , ( ) => {
2618+ const scmUri = 'github.com:102498:boat!"#$%&\'()-=|@`{;+]},<.>/ 🚗' ;
2619+
2620+ githubMock . request . resolves ( {
2621+ data : {
2622+ full_name : 'iAm/theCaptain' ,
2623+ private : true ,
2624+ visibility : 'internal'
2625+ }
2626+ } ) ;
2627+
2628+ return scm
2629+ . decorateUrl ( {
2630+ scmUri,
2631+ token : 'mytokenfortesting'
2632+ } )
2633+ . then ( data => {
2634+ assert . deepEqual ( data , {
2635+ branch : 'boat!"#$%&\'()-=|@`{;+]},<.>/ 🚗' ,
2636+ name : 'iAm/theCaptain' ,
2637+ url : `https://github.com/iAm/theCaptain/tree/${ encodeURIComponent (
2638+ 'boat!"#$%&\'()-=|@`{;+]},<.>/ 🚗'
2639+ ) } `,
2640+ rootDir : '' ,
2641+ private : false
2642+ } ) ;
2643+ assert . calledWith ( githubMock . request , 'GET /repositories/:id' , { id : '102498' } ) ;
2644+ } ) ;
2645+ } ) ;
2646+
25872647 it ( 'decorates a scm uri with rootDir' , ( ) => {
25882648 const scmUri = 'github.com:102498:boat!"#$%&\'()-=|@`{;+]},<.>/ 🚗:src/app/component' ;
25892649
0 commit comments