trypost/tests/Feature/Auth/SignupRequiresCheckoutTest.php
Paulo Castellano 3e15144399 chore: remove unused Pennant package and dead user-timezone handling
Pennant: all feature flags were replaced by BillingCycle, so remove the package
(composer), the now-empty app/Features discovery, the pennant-development skill,
and replace the create_features_table migration with a drop_features_table.

Timezone: the registration flow collected a user timezone (seeder, request
validation, hidden field) but no timezone column ever existed and CreateUser
discarded it. Remove the dead handling, the orphaned Timezone rule, and the
tests that covered the now-removed validation.
2026-06-22 13:37:38 -03:00

40 lines
1.2 KiB
PHP

<?php
declare(strict_types=1);
use App\Actions\User\CreateUser;
use App\Enums\Plan\Slug;
use Database\Seeders\PlanSeeder;
beforeEach(function () {
config(['trypost.self_hosted' => false]);
config(['trypost.billing.require_card_for_trial' => true]);
$this->seed(PlanSeeder::class);
});
test('new signup does not create a trial before checkout', function () {
$user = CreateUser::execute([
'name' => 'Alice',
'email' => 'alice@example.com',
'password' => 'password123',
'registration_ip' => '127.0.0.1',
]);
expect($user->account->plan_id)->toBeNull();
expect($user->account->trial_ends_at)->toBeNull();
expect($user->account->stripe_id)->toBeNull();
});
test('new signup creates generic trial when card is not required', function () {
config(['trypost.billing.require_card_for_trial' => false]);
$user = CreateUser::execute([
'name' => 'Alice',
'email' => 'alice+nocard@example.com',
'password' => 'password123',
'registration_ip' => '127.0.0.1',
]);
expect($user->account->plan->slug)->toBe(Slug::Workspace);
expect($user->account->trial_ends_at)->not->toBeNull();
});