@@ -13,9 +13,7 @@ mock.module("../shared/ui", () => ({
1313 prompt : mockPrompt ,
1414} ) ) ;
1515
16- const { getBillingUrl, getSetupSteps, handleBillingError, isBillingError, showNonBillingError } = await import (
17- "../shared/billing-guidance"
18- ) ;
16+ const { handleBillingError, isBillingError, showNonBillingError } = await import ( "../shared/billing-guidance" ) ;
1917
2018describe ( "isBillingError" , ( ) => {
2119 describe ( "hetzner" , ( ) => {
@@ -84,51 +82,13 @@ describe("isBillingError", () => {
8482 } ) ;
8583 } ) ;
8684
87- describe ( "daytona" , ( ) => {
88- it ( "matches billing/plan errors" , ( ) => {
89- expect ( isBillingError ( "daytona" , "quota exceeded" ) ) . toBe ( true ) ;
90- expect ( isBillingError ( "daytona" , "plan limit reached" ) ) . toBe ( true ) ;
91- } ) ;
92-
93- it ( "returns false for non-billing errors" , ( ) => {
94- expect ( isBillingError ( "daytona" , "sandbox creation failed" ) ) . toBe ( false ) ;
95- expect ( isBillingError ( "daytona" , "internal server error" ) ) . toBe ( false ) ;
96- } ) ;
97- } ) ;
98-
9985 describe ( "unknown cloud" , ( ) => {
10086 it ( "returns false for unknown clouds" , ( ) => {
10187 expect ( isBillingError ( "unknown" , "billing error" ) ) . toBe ( false ) ;
10288 } ) ;
10389 } ) ;
10490} ) ;
10591
106- describe ( "getBillingUrl" , ( ) => {
107- it ( "returns correct URLs for known clouds" , ( ) => {
108- expect ( getBillingUrl ( "hetzner" ) ) . toBe ( "https://console.hetzner.cloud/" ) ;
109- expect ( getBillingUrl ( "digitalocean" ) ) . toBe ( "https://cloud.digitalocean.com/account/billing" ) ;
110- expect ( getBillingUrl ( "aws" ) ) . toBe ( "https://lightsail.aws.amazon.com/" ) ;
111- expect ( getBillingUrl ( "gcp" ) ) . toBe ( "https://console.cloud.google.com/billing" ) ;
112- expect ( getBillingUrl ( "daytona" ) ) . toBe ( "https://app.daytona.io/dashboard" ) ;
113- } ) ;
114-
115- it ( "returns undefined for unknown clouds" , ( ) => {
116- expect ( getBillingUrl ( "unknown" ) ) . toBeUndefined ( ) ;
117- } ) ;
118- } ) ;
119-
120- describe ( "getSetupSteps" , ( ) => {
121- it ( "returns steps for known clouds" , ( ) => {
122- const steps = getSetupSteps ( "hetzner" ) ;
123- expect ( steps . length ) . toBeGreaterThan ( 0 ) ;
124- expect ( steps [ 0 ] ) . toContain ( "Hetzner" ) ;
125- } ) ;
126-
127- it ( "returns empty array for unknown clouds" , ( ) => {
128- expect ( getSetupSteps ( "unknown" ) ) . toEqual ( [ ] ) ;
129- } ) ;
130- } ) ;
131-
13292describe ( "handleBillingError" , ( ) => {
13393 let stderrSpy : ReturnType < typeof spyOn > ;
13494
0 commit comments