From 134ab631d43480fdeb014130f01538f06827e1ba Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Thu, 30 Mar 2023 15:38:22 -0700 Subject: [PATCH] Add test to ensure notification is not sent for license checkouts if not enabled --- .../LicenseCheckoutWebhookNotificationTest.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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); + } }