Fix post-registration 404, add speaker management, and simplify event creation.
Deploy Ladill Events / deploy (push) Successful in 28s
Deploy Ladill Events / deploy (push) Successful in 28s
Proxy registration transaction paths on Events, add a join button on the confirmation page, introduce speaker roster management, and replace the QR design wizard with merchant-style create/show flows. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,103 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use App\Models\QrCode;
|
||||
use App\Models\User;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Tests\TestCase;
|
||||
|
||||
class EventSpeakerManagementTest extends TestCase
|
||||
{
|
||||
use RefreshDatabase;
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$this->withoutMiddleware(\App\Http\Middleware\EnsurePlatformSession::class);
|
||||
Http::fake([
|
||||
config('billing.api_url').'/balance*' => Http::response(['balance_minor' => 50000]),
|
||||
]);
|
||||
}
|
||||
|
||||
public function test_speakers_sidebar_hub_lists_events(): void
|
||||
{
|
||||
$owner = User::factory()->create(['public_id' => 'usr_speakers_hub']);
|
||||
|
||||
QrCode::create([
|
||||
'user_id' => $owner->id,
|
||||
'short_code' => 'evt-speakers-1',
|
||||
'type' => QrCode::TYPE_EVENT,
|
||||
'label' => 'Leadership summit',
|
||||
'payload' => ['content' => ['name' => 'Leadership summit', 'speakers' => [['name' => 'Ada Lovelace', 'email' => '', 'role' => 'Keynote', 'bio' => '']]], 'style' => []],
|
||||
'is_active' => true,
|
||||
]);
|
||||
|
||||
$this->actingAs($owner)
|
||||
->get(route('speakers.index'))
|
||||
->assertOk()
|
||||
->assertSee('Leadership summit', false)
|
||||
->assertSee('Speakers', false);
|
||||
}
|
||||
|
||||
public function test_event_speaker_roster_can_be_updated(): void
|
||||
{
|
||||
$owner = User::factory()->create(['public_id' => 'usr_speakers_upd']);
|
||||
|
||||
$event = QrCode::create([
|
||||
'user_id' => $owner->id,
|
||||
'short_code' => 'evt-speakers-2',
|
||||
'type' => QrCode::TYPE_EVENT,
|
||||
'label' => 'Dev day',
|
||||
'payload' => ['content' => ['name' => 'Dev day'], 'style' => []],
|
||||
'is_active' => true,
|
||||
]);
|
||||
|
||||
$this->actingAs($owner)
|
||||
->put(route('speakers.update', $event), [
|
||||
'speakers' => [
|
||||
['name' => 'Jane Doe', 'email' => 'jane@example.com', 'role' => 'Panelist', 'bio' => ''],
|
||||
],
|
||||
])
|
||||
->assertRedirect(route('speakers.show', $event));
|
||||
|
||||
$event->refresh();
|
||||
$this->assertSame('Jane Doe', $event->content()['speakers'][0]['name']);
|
||||
$this->assertSame('jane@example.com', $event->content()['speakers'][0]['email']);
|
||||
}
|
||||
|
||||
public function test_event_create_page_has_no_qr_design_wizard(): void
|
||||
{
|
||||
$owner = User::factory()->create(['public_id' => 'usr_evt_create_simple']);
|
||||
|
||||
$this->actingAs($owner)
|
||||
->get(route('events.create'))
|
||||
->assertOk()
|
||||
->assertSee('Create event', false)
|
||||
->assertSee('generated automatically', false)
|
||||
->assertDontSee('Quick style presets', false)
|
||||
->assertDontSee('Review & create', false);
|
||||
}
|
||||
|
||||
public function test_event_show_page_has_downloads_not_qr_customizer(): void
|
||||
{
|
||||
$owner = User::factory()->create(['public_id' => 'usr_evt_show_simple']);
|
||||
|
||||
$event = QrCode::create([
|
||||
'user_id' => $owner->id,
|
||||
'short_code' => 'evt-show-simple',
|
||||
'type' => QrCode::TYPE_EVENT,
|
||||
'label' => 'Simple show',
|
||||
'payload' => ['content' => ['name' => 'Simple show'], 'style' => []],
|
||||
'is_active' => true,
|
||||
]);
|
||||
|
||||
$this->actingAs($owner)
|
||||
->get(route('events.show', $event))
|
||||
->assertOk()
|
||||
->assertSee('Customize colors, logos, and frames in QR Plus.', false)
|
||||
->assertSee('Programme outline', false)
|
||||
->assertDontSee('Quick style presets', false);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user