Fix speaker token ignored after badge verification or active join.
Deploy Ladill Meet / deploy (push) Successful in 1m0s
Deploy Ladill Meet / deploy (push) Successful in 1m0s
Process ?speaker= before registration gate and already-joined redirects so Events speakers get panelist role even when they previously registered as attendees. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -267,6 +267,81 @@ class EventsJoinGateTest extends TestCase
|
||||
]);
|
||||
}
|
||||
|
||||
public function test_speaker_token_applies_after_attendee_badge_verification(): void
|
||||
{
|
||||
$room = $this->createEventsLinkedRoom('webinar', [
|
||||
'settings' => array_merge(config('meet.default_settings'), [
|
||||
'join_before_host' => true,
|
||||
'waiting_room' => false,
|
||||
]),
|
||||
]);
|
||||
|
||||
$session = Session::create([
|
||||
'owner_ref' => $this->user->public_id,
|
||||
'room_id' => $room->id,
|
||||
'media_room_name' => 'room-'.$room->uuid,
|
||||
'status' => 'live',
|
||||
'started_at' => now(),
|
||||
]);
|
||||
$room->update(['status' => 'live']);
|
||||
|
||||
$this->post('/r/'.$room->uuid.'/verify-badge', ['badge_code' => 'BADGE123'])
|
||||
->assertRedirect(route('meet.join', $room));
|
||||
|
||||
$this->get('/r/'.$room->uuid.'?speaker=speaker-token-123')
|
||||
->assertRedirect(route('meet.join', $room));
|
||||
|
||||
$this->post('/r/'.$room->uuid.'/enter', [
|
||||
'display_name' => 'Keynote Speaker',
|
||||
])->assertRedirect(route('meet.room', $session));
|
||||
|
||||
$this->assertDatabaseHas('meet_participants', [
|
||||
'session_id' => $session->id,
|
||||
'display_name' => 'Keynote Speaker',
|
||||
'email' => 'speaker@example.com',
|
||||
'role' => 'panelist',
|
||||
]);
|
||||
}
|
||||
|
||||
public function test_speaker_link_promotes_already_joined_attendee(): void
|
||||
{
|
||||
$room = $this->createEventsLinkedRoom('webinar', [
|
||||
'settings' => array_merge(config('meet.default_settings'), [
|
||||
'join_before_host' => true,
|
||||
'waiting_room' => false,
|
||||
]),
|
||||
]);
|
||||
|
||||
$session = Session::create([
|
||||
'owner_ref' => $this->user->public_id,
|
||||
'room_id' => $room->id,
|
||||
'media_room_name' => 'room-'.$room->uuid,
|
||||
'status' => 'live',
|
||||
'started_at' => now(),
|
||||
]);
|
||||
$room->update(['status' => 'live']);
|
||||
|
||||
$participant = \App\Models\Participant::create([
|
||||
'owner_ref' => $this->user->public_id,
|
||||
'session_id' => $session->id,
|
||||
'display_name' => 'Keynote Speaker',
|
||||
'email' => 'speaker@example.com',
|
||||
'role' => 'attendee',
|
||||
'status' => 'joined',
|
||||
'joined_at' => now(),
|
||||
]);
|
||||
|
||||
$this->withSession(["meet.participant.{$session->uuid}" => $participant->uuid])
|
||||
->get('/r/'.$room->uuid.'?speaker=speaker-token-123')
|
||||
->assertRedirect(route('meet.room', $session));
|
||||
|
||||
$this->assertDatabaseHas('meet_participants', [
|
||||
'session_id' => $session->id,
|
||||
'email' => 'speaker@example.com',
|
||||
'role' => 'panelist',
|
||||
]);
|
||||
}
|
||||
|
||||
/** @param array<string, mixed> $overrides */
|
||||
protected function createEventsLinkedRoom(string $type, array $overrides = []): Room
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user