Skip to content

A free open source IT asset/license management system

Add test to ensure notification is not sent for license checkouts if not enabled

Marcus Moore134ab631d434
diff --git a/tests/Feature/Notifications/LicenseCheckoutWebhookNotificationTest.php b/tests/Feature/Notifications/LicenseCheckoutWebhookNotificationTest.php
index e01a2dc62b..095e0c436c 100644
--- a/tests/Feature/Notifications/LicenseCheckoutWebhookNotificationTest.php
+++ b/tests/Feature/Notifications/LicenseCheckoutWebhookNotificationTest.php
@@ -44,4 +44,19 @@ class LicenseCheckoutWebhookNotificationTest extends TestCase
}
);
}
+
+ /** @dataProvider checkoutTargets */
+ public function testWebhookNotificationsAreNotSentOnLicenseCheckoutWhenWebhookSettingNotEnabled($checkoutTarget)
+ {
+ Notification::fake();
+
+ event(new CheckoutableCheckedOut(
+ LicenseSeat::factory()->create(),
+ $checkoutTarget(),
+ User::factory()->superuser()->create(),
+ ''
+ ));
+
+ Notification::assertNotSentTo(new AnonymousNotifiable, CheckoutLicenseSeatNotification::class);
+ }
}