Update guest PWA v2 UI and likes
This commit is contained in:
@@ -51,6 +51,52 @@ class EventJoinTokenExpiryActionTest extends TestCase
|
||||
);
|
||||
}
|
||||
|
||||
public function test_superadmin_can_toggle_demo_read_only_on_join_token(): void
|
||||
{
|
||||
$user = User::factory()->create(['role' => 'super_admin']);
|
||||
$event = Event::factory()->create([
|
||||
'date' => now()->addDays(10),
|
||||
]);
|
||||
|
||||
$token = $event->joinTokens()->latest('id')->first();
|
||||
|
||||
$this->bootSuperAdminPanel($user);
|
||||
|
||||
Livewire::test(ListEvents::class)
|
||||
->callAction(
|
||||
[
|
||||
TestAction::make('join_tokens')->table($event),
|
||||
TestAction::make('set_demo_read_only')
|
||||
->arguments(['token_id' => $token->id]),
|
||||
],
|
||||
[
|
||||
'demo_read_only' => true,
|
||||
]
|
||||
)
|
||||
->assertHasNoErrors();
|
||||
|
||||
$token->refresh();
|
||||
|
||||
$this->assertTrue((bool) data_get($token->metadata, 'demo_read_only', false));
|
||||
|
||||
Livewire::test(ListEvents::class)
|
||||
->callAction(
|
||||
[
|
||||
TestAction::make('join_tokens')->table($event),
|
||||
TestAction::make('set_demo_read_only')
|
||||
->arguments(['token_id' => $token->id]),
|
||||
],
|
||||
[
|
||||
'demo_read_only' => false,
|
||||
]
|
||||
)
|
||||
->assertHasNoErrors();
|
||||
|
||||
$token->refresh();
|
||||
|
||||
$this->assertFalse((bool) data_get($token->metadata, 'demo_read_only', false));
|
||||
}
|
||||
|
||||
private function bootSuperAdminPanel(User $user): void
|
||||
{
|
||||
$panel = Filament::getPanel('superadmin');
|
||||
|
||||
Reference in New Issue
Block a user