Gate Care branch management behind Pro like Frontdesk.
Deploy Ladill Care / deploy (push) Successful in 1m25s
Deploy Ladill Care / deploy (push) Successful in 1m25s
Free plans keep a single setup branch but get an upgrade screen for Branches; Pro/Enterprise unlock multi-branch management via plan features.
This commit is contained in:
@@ -95,6 +95,38 @@ class CareProTest extends TestCase
|
||||
->assertSessionHas('upsell');
|
||||
}
|
||||
|
||||
public function test_free_plan_is_blocked_from_branch_management(): void
|
||||
{
|
||||
$this->actingAs($this->owner)
|
||||
->get(route('care.branches.index'))
|
||||
->assertOk()
|
||||
->assertSee('Upgrade your plan')
|
||||
->assertDontSee('All branches');
|
||||
|
||||
$this->actingAs($this->owner)
|
||||
->post(route('care.branches.store'), [
|
||||
'name' => 'Second site',
|
||||
])
|
||||
->assertRedirect(route('care.pro.index'))
|
||||
->assertSessionHas('upsell');
|
||||
}
|
||||
|
||||
public function test_pro_plan_can_manage_branches(): void
|
||||
{
|
||||
$this->organization->update([
|
||||
'settings' => array_merge($this->organization->settings ?? [], [
|
||||
'plan' => 'pro',
|
||||
'plan_expires_at' => now()->addMonth()->toIso8601String(),
|
||||
]),
|
||||
]);
|
||||
|
||||
$this->actingAs($this->owner)
|
||||
->get(route('care.branches.index'))
|
||||
->assertOk()
|
||||
->assertSee('All branches')
|
||||
->assertSee('HQ');
|
||||
}
|
||||
|
||||
public function test_pro_plan_allows_unlimited_branches(): void
|
||||
{
|
||||
$this->organization->update([
|
||||
|
||||
@@ -128,12 +128,13 @@ class CareWebTest extends TestCase
|
||||
|
||||
public function test_branches_index_loads(): void
|
||||
{
|
||||
// Free plan: multi-branch management is Pro-gated (setup branch still exists).
|
||||
$this->actingAs($this->user)
|
||||
->get(route('care.branches.index'))
|
||||
->assertOk()
|
||||
->assertSee('All branches')
|
||||
->assertSee('Main Branch')
|
||||
->assertSee('Settings');
|
||||
->assertSee('Upgrade your plan')
|
||||
->assertSee('View plans')
|
||||
->assertDontSee('Main Branch');
|
||||
}
|
||||
|
||||
public function test_members_index_loads(): void
|
||||
|
||||
Reference in New Issue
Block a user