Skip to content

A free open source IT asset/license management system

Populate scenario

Marcus Moore1811e061aa1d
diff --git a/tests/Feature/Notifications/Webhooks/WebhookNotificationsUponBulkAssetCheckoutTest.php b/tests/Feature/Notifications/Webhooks/WebhookNotificationsUponBulkAssetCheckoutTest.php
index e1c9eb7986..69ec5c3a85 100644
--- a/tests/Feature/Notifications/Webhooks/WebhookNotificationsUponBulkAssetCheckoutTest.php
+++ b/tests/Feature/Notifications/Webhooks/WebhookNotificationsUponBulkAssetCheckoutTest.php
@@ -2,6 +2,10 @@
namespace Tests\Feature\Notifications\Webhooks;
+use App\Events\CheckoutablesCheckedOutInBulk;
+use App\Models\Asset;
+use App\Models\User;
+use Illuminate\Support\Facades\Notification;
use Tests\TestCase;
class WebhookNotificationsUponBulkAssetCheckoutTest extends TestCase
@@ -9,5 +13,26 @@ class WebhookNotificationsUponBulkAssetCheckoutTest extends TestCase
public function test_webbook_is_sent_upon_bulk_asset_checkout()
{
$this->markTestIncomplete();
+
+ Notification::fake();
+
+ $this->settings->enableSlackWebhook();
+
+ $assets = Asset::factory()->requiresAcceptance()->count(2)->create();
+ $target = User::factory()->create(['email' => '[email protected]']);
+ $admin = User::factory()->create();
+ $checkout_at = date('Y-m-d H:i:s');
+ $expected_checkin = '';
+
+ CheckoutablesCheckedOutInBulk::dispatch(
+ $assets,
+ $target,
+ $admin,
+ $checkout_at,
+ $expected_checkin,
+ 'A note here',
+ );
+
+ $this->assertSlackNotificationSent(BulkAssetCheckoutNotification::class);
}
}