Open-source social media scheduler built for AI agents and the teams behind them. Create, schedule and publish posts to every network through MCP or the REST API, or write them yourself in a composer your team will love.
PHP ai-agentsblueskyfacebookinstagramlaravellinkedinmastodonmcpmcp-serveropen-sourcerest-apiself-hostedsocial-mediasocial-media-managementsocial-media-schedulerthreadstiktokvuejsxyoutube
test(auth): cover remaining surfaces of the registration gate
Paulo Castellanoe4bc6f1d5c55
diff --git a/tests/Feature/Auth/AuthenticationTest.php b/tests/Feature/Auth/AuthenticationTest.phpindex 060b1218c..8a49a676a 100644--- a/tests/Feature/Auth/AuthenticationTest.php+++ b/tests/Feature/Auth/AuthenticationTest.php@@ -12,6 +12,26 @@ test('login screen can be rendered', function () {$response->assertOk();});+test('login page exposes selfHosted as false when SELF_HOSTED is off', function () {+ config()->set('trypost.self_hosted', false);++ $response = $this->get(route('login'));++ $response->assertOk();+ $page = $response->original->getData()['page'];+ expect($page['props']['selfHosted'])->toBeFalse();+});++test('login page exposes selfHosted as true when SELF_HOSTED is on', function () {+ config()->set('trypost.self_hosted', true);++ $response = $this->get(route('login'));++ $response->assertOk();+ $page = $response->original->getData()['page'];+ expect($page['props']['selfHosted'])->toBeTrue();+});+test('users can authenticate using the login screen', function () {$user = User::factory()->create();diff --git a/tests/Feature/Auth/RegistrationTest.php b/tests/Feature/Auth/RegistrationTest.phpindex 466a40d2c..495791ca2 100644--- a/tests/Feature/Auth/RegistrationTest.php+++ b/tests/Feature/Auth/RegistrationTest.php@@ -168,6 +168,19 @@ test('signup clears pending_invite_id from session', function () {expect(User::where('email', '[email protected]')->exists())->toBeTrue();});+test('register POST passes when self_hosted with invite query param even without prior session', function () {+ config()->set('trypost.self_hosted', true);++ $response = $this->post(route('register.store', ['invite' => 'invite-xyz']), [+ 'name' => 'Invitee',+ 'email' => '[email protected]',+ 'password' => 'Password123!',+ ]);++ $response->assertSessionHasNoErrors();+ expect(User::where('email', '[email protected]')->exists())->toBeTrue();+});+test('register works normally when not self_hosted even with pending invite in session', function () {config()->set('trypost.self_hosted', false);diff --git a/tests/Feature/Database/UserSeederTest.php b/tests/Feature/Database/UserSeederTest.phpnew file mode 100644index 000000000..b8a98dfac--- /dev/null+++ b/tests/Feature/Database/UserSeederTest.php@@ -0,0 +1,26 @@+<?php++declare(strict_types=1);++use App\Models\User;+use Database\Seeders\UserSeeder;++test('seeder creates the admin user and a workspace when database is empty', function () {+ expect(User::count())->toBe(0);++ $this->seed(UserSeeder::class);++ $admin = User::where('email', '[email protected]')->first();++ expect($admin)->not->toBeNull();+ expect($admin->account_id)->not->toBeNull();+ expect($admin->workspaces()->count())->toBe(1);+});++test('seeder is idempotent when a user already exists', function () {+ User::factory()->create();++ $this->seed(UserSeeder::class);++ expect(User::where('email', '[email protected]')->exists())->toBeFalse();+});