@@ -100,7 +100,9 @@ describe('repository selection', async () => {
100100 [ 'top_100' ]
101101 ) ;
102102 } ) ;
103+ } ) ;
103104
105+ describe ( 'custom owner' , async ( ) => {
104106 // Test the owner regex in various "good" cases
105107 const goodOwners = [
106108 'owner' ,
@@ -146,6 +148,18 @@ describe('repository selection', async () => {
146148 await expect ( mod . getRepositorySelection ( ) ) . to . be . rejectedWith ( Error , `Invalid user or organization: ${ owner } ` ) ;
147149 } ) ;
148150 } ) ;
151+
152+ it ( 'should be ok for the user to change their mind' , async ( ) => {
153+ quickPickSpy . resolves (
154+ { useAllReposOfOwner : true }
155+ ) ;
156+ getRemoteRepositoryListsSpy . returns ( { } ) ;
157+
158+ // The user pressed escape to cancel the operation
159+ showInputBoxSpy . resolves ( undefined ) ;
160+
161+ await expect ( mod . getRepositorySelection ( ) ) . to . be . rejectedWith ( UserCancellationException , 'No repositories selected' ) ;
162+ } ) ;
149163 } ) ;
150164
151165 describe ( 'custom repo' , async ( ) => {
@@ -196,6 +210,18 @@ describe('repository selection', async () => {
196210 await expect ( mod . getRepositorySelection ( ) ) . to . be . rejectedWith ( UserCancellationException , 'Invalid repository format' ) ;
197211 } ) ;
198212 } ) ;
213+
214+ it ( 'should be ok for the user to change their mind' , async ( ) => {
215+ quickPickSpy . resolves (
216+ { useCustomRepo : true }
217+ ) ;
218+ getRemoteRepositoryListsSpy . returns ( { } ) ;
219+
220+ // The user pressed escape to cancel the operation
221+ showInputBoxSpy . resolves ( undefined ) ;
222+
223+ await expect ( mod . getRepositorySelection ( ) ) . to . be . rejectedWith ( UserCancellationException , 'No repositories selected' ) ;
224+ } ) ;
199225 } ) ;
200226
201227 describe ( 'external repository lists file' , async ( ) => {
0 commit comments