@@ -194,7 +194,7 @@ describe("create-sentry-project", () => {
194194
195195 describe ( "resolveOrgSlug (called directly)" , ( ) => {
196196 test ( "single org fallback when resolveOrg returns null" , async ( ) => {
197- resolveOrgPrefetchedSpy . mockResolvedValue ( null ) ;
197+ resolveOrgSpy . mockResolvedValue ( null ) ;
198198 listOrgsSpy . mockResolvedValue ( [
199199 { id : "1" , slug : "solo-org" , name : "Solo Org" } ,
200200 ] ) ;
@@ -206,7 +206,7 @@ describe("create-sentry-project", () => {
206206 } ) ;
207207
208208 test ( "no orgs (not authenticated) returns error result" , async ( ) => {
209- resolveOrgPrefetchedSpy . mockResolvedValue ( null ) ;
209+ resolveOrgSpy . mockResolvedValue ( null ) ;
210210 listOrgsSpy . mockResolvedValue ( [ ] ) ;
211211
212212 const result = await resolveOrgSlug ( "/tmp/test" , false ) ;
@@ -218,7 +218,7 @@ describe("create-sentry-project", () => {
218218 } ) ;
219219
220220 test ( "multiple orgs + yes flag returns error with slug list" , async ( ) => {
221- resolveOrgPrefetchedSpy . mockResolvedValue ( null ) ;
221+ resolveOrgSpy . mockResolvedValue ( null ) ;
222222 listOrgsSpy . mockResolvedValue ( [
223223 { id : "1" , slug : "org-a" , name : "Org A" } ,
224224 { id : "2" , slug : "org-b" , name : "Org B" } ,
@@ -235,7 +235,7 @@ describe("create-sentry-project", () => {
235235 } ) ;
236236
237237 test ( "multiple orgs + interactive select picks chosen org" , async ( ) => {
238- resolveOrgPrefetchedSpy . mockResolvedValue ( null ) ;
238+ resolveOrgSpy . mockResolvedValue ( null ) ;
239239 listOrgsSpy . mockResolvedValue ( [
240240 { id : "1" , slug : "org-a" , name : "Org A" } ,
241241 { id : "2" , slug : "org-b" , name : "Org B" } ,
@@ -249,7 +249,7 @@ describe("create-sentry-project", () => {
249249 } ) ;
250250
251251 test ( "multiple orgs + user cancels select throws WizardCancelledError" , async ( ) => {
252- resolveOrgPrefetchedSpy . mockResolvedValue ( null ) ;
252+ resolveOrgSpy . mockResolvedValue ( null ) ;
253253 listOrgsSpy . mockResolvedValue ( [
254254 { id : "1" , slug : "org-a" , name : "Org A" } ,
255255 { id : "2" , slug : "org-b" , name : "Org B" } ,
@@ -295,23 +295,18 @@ describe("create-sentry-project", () => {
295295 expect ( data . dsn ) . toBe ( "" ) ;
296296 } ) ;
297297
298- describe ( "resolveOrgSlug — numeric org ID from DSN" , ( ) => {
299- test ( "numeric ID + cache hit → resolved to slug" , async ( ) => {
300- resolveOrgPrefetchedSpy . mockResolvedValue ( { org : "4507492088676352" } ) ;
301- getOrgByNumericIdSpy . mockReturnValue ( {
302- slug : "acme-corp" ,
303- regionUrl : "https://us.sentry.io" ,
304- } ) ;
298+ describe ( "resolveOrgSlug — resolveOrg integration" , ( ) => {
299+ test ( "returns org from resolveOrg when it resolves" , async ( ) => {
300+ resolveOrgSpy . mockResolvedValue ( { org : "acme-corp" } ) ;
305301
306302 const result = await resolveOrgSlug ( "/tmp/test" , false ) ;
307303
308304 expect ( result ) . toBe ( "acme-corp" ) ;
309- expect ( getOrgByNumericIdSpy ) . toHaveBeenCalledWith ( "4507492088676352" ) ;
305+ expect ( listOrgsSpy ) . not . toHaveBeenCalled ( ) ;
310306 } ) ;
311307
312- test ( "numeric ID + cache miss → falls through to single org in listOrganizations" , async ( ) => {
313- resolveOrgPrefetchedSpy . mockResolvedValue ( { org : "4507492088676352" } ) ;
314- getOrgByNumericIdSpy . mockReturnValue ( undefined ) ;
308+ test ( "falls through to listOrganizations when resolveOrg returns null" , async ( ) => {
309+ resolveOrgSpy . mockResolvedValue ( null ) ;
315310 listOrgsSpy . mockResolvedValue ( [
316311 { id : "1" , slug : "solo-org" , name : "Solo Org" } ,
317312 ] ) ;
@@ -320,22 +315,6 @@ describe("create-sentry-project", () => {
320315
321316 expect ( result ) . toBe ( "solo-org" ) ;
322317 } ) ;
323-
324- test ( "numeric ID + cache miss + multiple orgs + --yes → error with org list" , async ( ) => {
325- resolveOrgPrefetchedSpy . mockResolvedValue ( { org : "4507492088676352" } ) ;
326- getOrgByNumericIdSpy . mockReturnValue ( undefined ) ;
327- listOrgsSpy . mockResolvedValue ( [
328- { id : "1" , slug : "org-a" , name : "Org A" } ,
329- { id : "2" , slug : "org-b" , name : "Org B" } ,
330- ] ) ;
331-
332- const result = await resolveOrgSlug ( "/tmp/test" , true ) ;
333-
334- expect ( typeof result ) . toBe ( "object" ) ;
335- const err = result as { ok : boolean ; error : string } ;
336- expect ( err . ok ) . toBe ( false ) ;
337- expect ( err . error ) . toContain ( "Multiple organizations found" ) ;
338- } ) ;
339318 } ) ;
340319
341320 describe ( "detectExistingProject (called directly)" , ( ) => {
0 commit comments