@@ -276,6 +276,26 @@ describe("windsurf plugin", () => {
276276 expect ( result . lines . find ( ( line ) => line . label === "Extra usage balance" ) ?. value ) . toBe ( "$0.00" )
277277 } )
278278
279+ it ( "renders quota lines when Windsurf omits extra usage balance" , async ( ) => {
280+ const ctx = makeCtx ( )
281+ setupCloudMock ( ctx , {
282+ stableAuth : "sk-ws-01-stable" ,
283+ stableResponse : {
284+ status : 200 ,
285+ bodyText : JSON . stringify ( makeQuotaResponse ( { overageBalanceMicros : undefined } ) ) ,
286+ } ,
287+ } )
288+
289+ const plugin = await loadPlugin ( )
290+ const result = plugin . probe ( ctx )
291+
292+ expect ( result . plan ) . toBe ( "Teams" )
293+ expect ( result . lines ) . toHaveLength ( 2 )
294+ expect ( result . lines . find ( ( line ) => line . label === "Daily quota" ) ?. used ) . toBe ( 0 )
295+ expect ( result . lines . find ( ( line ) => line . label === "Weekly quota" ) ?. used ) . toBe ( 0 )
296+ expect ( result . lines . find ( ( line ) => line . label === "Extra usage balance" ) ) . toBeUndefined ( )
297+ } )
298+
279299 it ( "falls back to Unknown plan when planInfo is null" , async ( ) => {
280300 const ctx = makeCtx ( )
281301 setupCloudMock ( ctx , {
@@ -687,7 +707,7 @@ describe("windsurf plugin", () => {
687707 finiteSpy . mockRestore ( )
688708 } )
689709
690- it ( "throws quota unavailable when extra usage balance becomes invalid after contract validation" , async ( ) => {
710+ it ( "omits extra usage balance when it becomes invalid after contract validation" , async ( ) => {
691711 const ctx = makeCtx ( )
692712 const originalTryParseJson = ctx . util . tryParseJson
693713 ctx . util . tryParseJson = vi . fn ( ( text ) => {
@@ -723,7 +743,8 @@ describe("windsurf plugin", () => {
723743 } )
724744
725745 const plugin = await loadPlugin ( )
726- expect ( ( ) => plugin . probe ( ctx ) ) . toThrow ( "Windsurf quota data unavailable. Try again later." )
746+ const result = plugin . probe ( ctx )
747+ expect ( result . lines . find ( ( line ) => line . label === "Extra usage balance" ) ) . toBeUndefined ( )
727748 finiteSpy . mockRestore ( )
728749 } )
729750
0 commit comments