Skip to content

A free open source IT asset/license management system

Add failing test

Marcus Moored645b42e12aa
diff --git a/tests/Feature/Checkouts/Ui/BulkAssetCheckoutTest.php b/tests/Feature/Checkouts/Ui/BulkAssetCheckoutTest.php
new file mode 100644
index 0000000000..60f3087f48
--- /dev/null
+++ b/tests/Feature/Checkouts/Ui/BulkAssetCheckoutTest.php
@@ -0,0 +1,27 @@
+<?php
+
+namespace Tests\Feature\Checkouts\Ui;
+
+use App\Models\User;
+use Tests\TestCase;
+
+class BulkAssetCheckoutTest extends TestCase
+{
+ public function testHandleMissingModelBeingIncluded()
+ {
+ $this->actingAs(User::factory()->checkoutAssets()->create())
+ ->post(route('hardware.bulkcheckout.store'), [
+ 'selected_assets' => [
+ 1,
+ 9999999,
+ ],
+ 'checkout_to_type' => 'user',
+ 'assigned_user' => User::factory()->create()->id,
+ 'assigned_asset' => null,
+ 'checkout_at' => null,
+ 'expected_checkin' => null,
+ 'note' => null,
+ ])
+ ->assertSessionHas('error', trans_choice('admin/hardware/message.multi-checkout.error', 2));
+ }
+}