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

This commit is contained in:
Marcus Moore 2023-03-30 15:38:22 -07:00
parent 158e1544cd
commit 134ab631d4
No known key found for this signature in database

View file

@ -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);
}
}