orders
Nisse Lommerde 1 week ago
commit 73df66d0eb

@ -0,0 +1,38 @@
<?php
namespace Tests\Feature;
use App\Filament\Resources\OrderResource\Pages\ListOrders;
use App\Models\Customer;
use App\Models\Order;
use App\Models\OrderProduct;
use App\Models\ProductService;
use App\Models\ServiceFile;
use function Pest\Livewire\livewire;
it('can list posts', function () {
$customer = Customer::factory()->create();
$orders = Order::factory()->for($customer)->count(2)->create();
livewire(ListOrders::class)
->assertCanSeeTableRecords($orders);
});
it('can create a post', function () {
$customer = Customer::factory()->create();
$formData = Order::factory()->for($customer)->create();
$formData['order_products'] = OrderProduct::factory()->count(2)->create();
$formData['order_products'][0]['xs'] = 4;
$formData['order_products'][1]['s'] = 3;
$serviceFile1 = ServiceFile::factory()->create();
$serviceFile2 = ServiceFile::factory()->create();
$formData['services'][0] = ProductService::factory()->for($serviceFile1)->create();
$formData['services'][1] = ProductService::factory()->for($serviceFile2)->create();
dd($formData);
});
Loading…
Cancel
Save