From 906cb3033ea4f532e01c53c50f0359f1d6bef00b Mon Sep 17 00:00:00 2001 From: Ivan Moroz Date: Sun, 31 May 2026 18:22:27 +0300 Subject: [PATCH] CONV-088: Add recommended target marker Co-Authored-By: Claude Opus 4.8 --- .../livewire/dashboard/dashboard-converter.blade.php | 7 ++++++- tests/Feature/Livewire/DashboardConverterTest.php | 11 +++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/resources/views/livewire/dashboard/dashboard-converter.blade.php b/resources/views/livewire/dashboard/dashboard-converter.blade.php index 60f2eed..fee5cf2 100644 --- a/resources/views/livewire/dashboard/dashboard-converter.blade.php +++ b/resources/views/livewire/dashboard/dashboard-converter.blade.php @@ -76,7 +76,12 @@ class="flex flex-col items-center justify-center gap-4 rounded-[var(--ca-radius- class="flex items-start gap-3 rounded-[var(--ca-radius-md)] border border-[var(--ca-border)] bg-white p-4 text-left transition hover:border-[var(--ca-primary)] hover:bg-[var(--ca-primary)]/5 ca-focus-ring"> - {{ $card->label }} + + {{ $card->label }} + @if ($card->recommended) + Recommended + @endif + {{ $card->description }} diff --git a/tests/Feature/Livewire/DashboardConverterTest.php b/tests/Feature/Livewire/DashboardConverterTest.php index 2db5f03..4345e83 100644 --- a/tests/Feature/Livewire/DashboardConverterTest.php +++ b/tests/Feature/Livewire/DashboardConverterTest.php @@ -112,3 +112,14 @@ expect($cards)->each->toBeInstanceOf(TargetFormatCardViewModel::class); expect(collect($cards)->pluck('targetFormat')->all())->toContain('jpg', 'webp', 'pdf'); }); + +it('renders a recommended badge on the recommended target card', function () { + $user = User::factory()->create(); + $file = FileRecord::factory()->for($user)->create(['extension' => 'png']); + + Livewire::actingAs($user) + ->test(DashboardConverter::class) + ->set('currentFileId', $file->id) + ->call('goToFormatStep') + ->assertSee('Recommended'); +});