Merge pull request #2019 from burakcakirel/customer-export-test

Customer export test fails when the apps create a customer in their t…
This commit is contained in:
Cüneyt Şentürk 2021-05-03 14:16:26 +03:00 committed by GitHub
commit b33dd23141
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -122,8 +122,8 @@ class CustomersTest extends FeatureTestCase
public function testItShouldExportCustomers()
{
$count = 5;
Contact::factory()->customer()->count($count)->create();
Contact::factory()->customer()->count(5)->create();
$count = Contact::count();
\Excel::fake();
@ -135,7 +135,7 @@ class CustomersTest extends FeatureTestCase
\Str::filename(trans_choice('general.customers', 2)) . '.xlsx',
function (Export $export) use ($count) {
// Assert that the correct export is downloaded.
return $export->collection()->count() === $count + 1;
return $export->collection()->count() === $count;
}
);
}