@@ -44,6 +44,7 @@ describe('index test', () => {
4444 'decorateCommit' ,
4545 'decorateAuthor' ,
4646 'getPermissions' ,
47+ 'getOrgPermissions' ,
4748 'getCommitSha' ,
4849 'updateCommitStatus' ,
4950 'getFile' ,
@@ -675,7 +676,7 @@ describe('index test', () => {
675676 describe ( '_getPermissions' , ( ) => {
676677 const config = { scmContext : 'example.context' } ;
677678
678- it ( 'call origin getPermissons ' , ( ) => {
679+ it ( 'call origin getPermissions ' , ( ) => {
679680 const scmGithub = scm . scms [ 'github.context' ] ;
680681 const exampleScm = scm . scms [ 'example.context' ] ;
681682 const scmGitlab = scm . scms [ 'gitlab.context' ] ;
@@ -691,6 +692,25 @@ describe('index test', () => {
691692 } ) ;
692693 } ) ;
693694
695+ describe ( '_getOrgPermissions' , ( ) => {
696+ const config = { scmContext : 'example.context' } ;
697+
698+ it ( 'call origin getOrgPermissions' , ( ) => {
699+ const scmGithub = scm . scms [ 'github.context' ] ;
700+ const exampleScm = scm . scms [ 'example.context' ] ;
701+ const scmGitlab = scm . scms [ 'gitlab.context' ] ;
702+
703+ return scm . _getOrgPermissions ( config )
704+ . then ( ( result ) => {
705+ assert . strictEqual ( result , 'example' ) ;
706+ assert . notCalled ( scmGithub . getOrgPermissions ) ;
707+ assert . notCalled ( scmGitlab . getOrgPermissions ) ;
708+ assert . calledOnce ( exampleScm . getOrgPermissions ) ;
709+ assert . calledWith ( exampleScm . getOrgPermissions , config ) ;
710+ } ) ;
711+ } ) ;
712+ } ) ;
713+
694714 describe ( '_getCommitSha' , ( ) => {
695715 const config = { scmContext : 'example.context' } ;
696716
0 commit comments