Seed DemoWorld attendees and speakers for Events demo continuity
Deploy Ladill Events / deploy (push) Successful in 1m18s
Deploy Ladill Events / deploy (push) Successful in 1m18s
Attendee registrations, programme hosts, and event speakers now draw name/email/phone/company from DemoWorld people instead of generic placeholders, and 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\QrCode;
|
||||
use App\Models\QrEventRegistration;
|
||||
use App\Models\User;
|
||||
use App\Services\Events\SubscriptionService;
|
||||
use App\Support\DemoWorld;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Illuminate\Support\Str;
|
||||
use Tests\TestCase;
|
||||
@@ -128,4 +129,33 @@ class DemoSeedCommandTest extends TestCase
|
||||
$this->assertNotNull($user);
|
||||
$this->assertSame('demo-new@ladill.com', $user->email);
|
||||
}
|
||||
|
||||
public function test_pro_plan_uses_demo_world_attendees_and_speakers(): void
|
||||
{
|
||||
$user = User::factory()->create([
|
||||
'public_id' => (string) Str::uuid(),
|
||||
'email' => 'demo-pro@ladill.com',
|
||||
]);
|
||||
|
||||
$this->artisan('demo:seed', [
|
||||
'identity' => $user->email,
|
||||
'--plan' => 'pro',
|
||||
])->assertSuccessful();
|
||||
|
||||
$registration = QrEventRegistration::query()
|
||||
->where('user_id', $user->id)
|
||||
->where('attendee_name', 'Ama Mensah')
|
||||
->first();
|
||||
$this->assertNotNull($registration);
|
||||
$this->assertSame(DemoWorld::personByKey('ama-mensah')['email'], $registration->attendee_email);
|
||||
$this->assertSame(DemoWorld::personByKey('ama-mensah')['phone'], $registration->attendee_phone);
|
||||
|
||||
$programme = QrCode::query()
|
||||
->where('user_id', $user->id)
|
||||
->where('type', QrCode::TYPE_ITINERARY)
|
||||
->first();
|
||||
$this->assertNotNull($programme);
|
||||
$host = $programme->content()['days'][0]['items'][0]['host'] ?? null;
|
||||
$this->assertSame('Ama Mensah', $host);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user