Context
The invoices list has a "Download PDF" action stub but it currently does nothing. Users must navigate to the invoice edit view to obtain the PDF. Completing this action makes PDF retrieval a one-click operation.
Related: #190 covers the same action from within the EditInvoice page header. Both issues share the same underlying InvoiceService::generatePdf() implementation.
User story
As a user, I want to click Download PDF in the invoice row dropdown so I can download the invoice PDF without opening the edit form.
Acceptance criteria
Arrange · Act · Assert
// Modules/Invoices/Tests/Feature/InvoicesTest.php
#[Test]
public function it_downloads_pdf_from_invoice_list(): void
{
/* Arrange */
$invoice = Invoice::factory()->for($this->company)->create([
'invoice_number' => 'INV-2026-001',
]);
/* Act */
$component = Livewire::actingAs($this->user)
->test(ListInvoices::class, ['tenant' => Str::lower($this->company->search_code)])
->callTableAction('download-pdf', $invoice);
/* Assert */
$component->assertSuccessful();
$component->assertFileDownloaded('INV-2026-001.pdf');
}
Context
The invoices list has a "Download PDF" action stub but it currently does nothing. Users must navigate to the invoice edit view to obtain the PDF. Completing this action makes PDF retrieval a one-click operation.
User story
As a user, I want to click Download PDF in the invoice row dropdown so I can download the invoice PDF without opening the edit form.
Acceptance criteria
Arrange · Act · Assert