(string) Str::uuid(), 'name' => 'A', 'email' => 'a+'.uniqid().'@x.com']); } private function fakeBillingApi(string $publicId): void { $base = rtrim((string) config('billing.api_url'), '/'); Http::fake([ $base.'/balance*' => Http::response(['balance_minor' => 50000]), $base.'/service-ledger*' => Http::response([ 'spent_minor' => 1200, 'credited_minor' => 0, 'net_minor' => -1200, ]), ]); } public function test_billing_page_shows_storage_breakdown(): void { $user = $this->user(); $this->fakeBillingApi($user->public_id); Transfer::create([ 'user_id' => $user->id, 'title' => 'Client deliverables', 'retention_days' => 30, 'expires_at' => now()->addDays(30), 'status' => Transfer::STATUS_ACTIVE, 'storage_bytes' => 2 * 1024 * 1024 * 1024, ]); $this->actingAs($user) ->get(route('account.billing')) ->assertOk() ->assertSee('Active transfer storage') ->assertSee('Client deliverables') ->assertSee('Monthly estimate') ->assertDontSee('Add funds'); } public function test_wallet_page_focuses_on_balance(): void { $user = $this->user(); $this->fakeBillingApi($user->public_id); $this->actingAs($user) ->get(route('account.wallet')) ->assertOk() ->assertSee('Add funds') ->assertDontSee('Active transfer storage'); } }