Seed DemoWorld business and customer continuity for Woo Manager demos
Deploy Ladill Woo Manager / deploy (push) Successful in 47s
Deploy Ladill Woo Manager / deploy (push) Successful in 47s
Store site names now reference the DemoWorld business identity for the active plan, and order customers use DemoWorld people (name, email, phone) instead of generic "Demo Customer N" placeholders. Staff logins skip the login reseed. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -7,6 +7,7 @@ use App\Models\Woo\ProSubscription;
|
||||
use App\Models\WooOrder;
|
||||
use App\Models\WooProduct;
|
||||
use App\Models\WooStore;
|
||||
use App\Support\DemoWorld;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Tests\TestCase;
|
||||
|
||||
@@ -74,4 +75,22 @@ class DemoSeedCommandTest extends TestCase
|
||||
$this->assertCount(1, WooStore::query()->where('user_id', $user->id)->get());
|
||||
$this->assertDatabaseMissing('woo_pro_subscriptions', ['user_id' => $user->id]);
|
||||
}
|
||||
|
||||
public function test_pro_plan_uses_demo_world_business_and_customer_continuity(): void
|
||||
{
|
||||
$user = User::factory()->create(['email' => 'demo-pro@ladill.com']);
|
||||
|
||||
$this->artisan('demo:seed', ['identity' => $user->email, '--plan' => 'pro'])
|
||||
->assertSuccessful();
|
||||
|
||||
$store = WooStore::query()->where('user_id', $user->id)->first();
|
||||
$this->assertStringContainsString(DemoWorld::business('pro')['name'], $store->site_name);
|
||||
|
||||
$firstPerson = DemoWorld::people(1)[0];
|
||||
$this->assertDatabaseHas('woo_orders', [
|
||||
'woo_store_id' => $store->id,
|
||||
'customer_name' => DemoWorld::fullName($firstPerson),
|
||||
'customer_email' => $firstPerson['email'],
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user