Skip to content

Test cases for multiple sheet #4014

Answered by patrickbrouwers
FFasna asked this question in Q&A
Discussion options

You must be logged in to vote

Sounds like you want to do the following:

class SourceDocumentsTemplateExport implements WithMultipleSheets
{
    public function sheets(): array
    {
        return [
            new SourcesPrimarySheet(),
            new CompanyDropdown('name'),
            new CompanyDropdown('category'),
            new CompanyDropdown('type'),
            new CompanyDropdown('status'),
        ];
    }
}
it('user_can_download_invoices_export', function () {
    Excel::fake();
    $response = $this->get('/source/export');
    $response->assertStatus(200);

    Excel::assertDownloaded('sources.xlsx', function (SourceDocumentsTemplateExport $export) {
        // Assert that the correct export is downl…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@FFasna
Comment options

Answer selected by FFasna
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants