Update guest v2 branding and theming
This commit is contained in:
35
tests/Feature/Api/Event/EventQrCodeTest.php
Normal file
35
tests/Feature/Api/Event/EventQrCodeTest.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature\Api\Event;
|
||||
|
||||
use App\Models\Event;
|
||||
use App\Services\EventJoinTokenService;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Tests\TestCase;
|
||||
|
||||
class EventQrCodeTest extends TestCase
|
||||
{
|
||||
use RefreshDatabase;
|
||||
|
||||
public function test_guest_can_fetch_event_qr_code(): void
|
||||
{
|
||||
$event = Event::factory()->create([
|
||||
'status' => 'published',
|
||||
]);
|
||||
|
||||
$token = app(EventJoinTokenService::class)->createToken($event);
|
||||
|
||||
$response = $this->getJson("/api/v1/events/{$token->token}/qr?size=240");
|
||||
|
||||
$response->assertOk()
|
||||
->assertJsonStructure([
|
||||
'url',
|
||||
'qr_code_data_url',
|
||||
])
|
||||
->assertJsonPath('url', url('/e/'.$token->token));
|
||||
|
||||
$dataUrl = $response->json('qr_code_data_url');
|
||||
$this->assertIsString($dataUrl);
|
||||
$this->assertStringStartsWith('data:image/png;base64,', $dataUrl);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user