@@ -38,6 +38,7 @@ describe('UserStore', function() {
3838 const opts = {
3939 owner : 'me' ,
4040 name : 'stuff' ,
41+ repositoryFound : true ,
4142 ...options ,
4243 } ;
4344
@@ -50,7 +51,7 @@ describe('UserStore', function() {
5051 name : 'GetMentionableUsers' ,
5152 variables : { owner : opts . owner , name : opts . name , first : 100 , after : lastCursor } ,
5253 } , {
53- repository : {
54+ repository : ! opts . repositoryFound ? null : {
5455 mentionableUsers : {
5556 nodes : page ,
5657 pageInfo : {
@@ -173,6 +174,27 @@ describe('UserStore', function() {
173174 ] ) ;
174175 } ) ;
175176
177+ it ( 'skips GitHub remotes that no longer exist' , async function ( ) {
178+ await login . setToken ( 'https://api.github.com' , '1234' ) ;
179+
180+ const workdirPath = await cloneRepository ( 'multiple-commits' ) ;
181+ const repository = await buildRepository ( workdirPath ) ;
182+
183+ await repository . setConfig ( 'remote.origin.url' , '[email protected] :me/stuff.git' ) ; 184+ await repository . setConfig ( 'remote.origin.fetch' , '+refs/heads/*:refs/remotes/origin/*' ) ;
185+
186+ const [ { resolve, promise} ] = expectPagedRelayQueries ( { repositoryFound : false } , [ ] ) ;
187+
188+ store = new UserStore ( { repository, login, config} ) ;
189+ await nextUpdatePromise ( ) ;
190+
191+ resolve ( ) ;
192+ // nextUpdatePromise will not fire because the update is empty
193+ await promise ;
194+
195+ assert . deepEqual ( store . getUsers ( ) , [ ] ) ;
196+ } ) ;
197+
176198 it ( 'infers no-reply emails for users without a public email address' , async function ( ) {
177199 await login . setToken ( 'https://api.github.com' , '1234' ) ;
178200
@@ -406,8 +428,8 @@ describe('UserStore', function() {
406428 const actualToken = await store . getToken ( loginModel , 'https://api.github.com' ) ;
407429 assert . strictEqual ( expectedToken , actualToken ) ;
408430 } ) ;
409-
410431 } ) ;
432+
411433 describe ( 'loadMentionableUsers' , function ( ) {
412434 it ( 'returns undefined if token is null' , async function ( ) {
413435 const workdirPath = await cloneRepository ( 'multiple-commits' ) ;
0 commit comments