Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion resources/views/livewire/dashboard/dashboard-converter.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,18 @@ class="flex items-center justify-between gap-4 rounded-[var(--ca-radius-md)] bor
<p class="text-base font-semibold text-[var(--ca-text)]">
Ready to convert {{ strtoupper($file->extension) }} to {{ strtoupper($selectedTargetFormat) }}
</p>
<p class="mt-1 text-sm text-[var(--ca-muted)]">Conversion will be available in Phase 9.</p>
</div>

<x-button
wire:click="convert"
wire:loading.attr="disabled"
wire:target="convert"
:disabled="$step === 'converting'"
class="w-full"
>
<span wire:loading.remove wire:target="convert">Convert Now</span>
<span wire:loading wire:target="convert">Starting…</span>
</x-button>
</div>
@endif
</x-card>
Expand Down
19 changes: 19 additions & 0 deletions tests/Feature/Livewire/DashboardConverterConvertTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,22 @@

expect(ConversionJob::query()->count())->toBe(1);
});

it('does not create duplicate conversion jobs on repeated convert calls', function () {
Queue::fake();
Storage::fake('local');

$user = User::factory()->create();

$component = Livewire::actingAs($user)
->test(DashboardConverter::class)
->set('upload', UploadedFile::fake()->image('avatar.png', 800, 600))
->call('selectTargetFormat', 'jpg')
->set('options.quality', 'high')
->call('continueFromSettings');

$component->call('convert');
$component->call('convert');

expect(ConversionJob::query()->count())->toBe(1);
});