@@ -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- resolveOrgSpy . mockResolvedValue ( null ) ;
197+ resolveOrgPrefetchedSpy . 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- resolveOrgSpy . mockResolvedValue ( null ) ;
209+ resolveOrgPrefetchedSpy . 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- resolveOrgSpy . mockResolvedValue ( null ) ;
221+ resolveOrgPrefetchedSpy . 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- resolveOrgSpy . mockResolvedValue ( null ) ;
238+ resolveOrgPrefetchedSpy . 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- resolveOrgSpy . mockResolvedValue ( null ) ;
252+ resolveOrgPrefetchedSpy . mockResolvedValue ( null ) ;
253253 listOrgsSpy . mockResolvedValue ( [
254254 { id : "1" , slug : "org-a" , name : "Org A" } ,
255255 { id : "2" , slug : "org-b" , name : "Org B" } ,
@@ -296,8 +296,8 @@ describe("create-sentry-project", () => {
296296 } ) ;
297297
298298 describe ( "resolveOrgSlug — resolveOrg integration" , ( ) => {
299- test ( "returns org from resolveOrg when it resolves" , async ( ) => {
300- resolveOrgSpy . mockResolvedValue ( { org : "acme-corp" } ) ;
299+ test ( "returns org slug when resolveOrg resolves" , async ( ) => {
300+ resolveOrgPrefetchedSpy . mockResolvedValue ( { org : "acme-corp" } ) ;
301301
302302 const result = await resolveOrgSlug ( "/tmp/test" , false ) ;
303303
@@ -306,7 +306,18 @@ describe("create-sentry-project", () => {
306306 } ) ;
307307
308308 test ( "falls through to listOrganizations when resolveOrg returns null" , async ( ) => {
309- resolveOrgSpy . mockResolvedValue ( null ) ;
309+ resolveOrgPrefetchedSpy . mockResolvedValue ( null ) ;
310+ listOrgsSpy . mockResolvedValue ( [
311+ { id : "1" , slug : "solo-org" , name : "Solo Org" } ,
312+ ] ) ;
313+
314+ const result = await resolveOrgSlug ( "/tmp/test" , false ) ;
315+
316+ expect ( result ) . toBe ( "solo-org" ) ;
317+ } ) ;
318+
319+ test ( "numeric ID from resolveOrg falls through to org picker" , async ( ) => {
320+ resolveOrgPrefetchedSpy . mockResolvedValue ( { org : "4507492088676352" } ) ;
310321 listOrgsSpy . mockResolvedValue ( [
311322 { id : "1" , slug : "solo-org" , name : "Solo Org" } ,
312323 ] ) ;
0 commit comments