createOne(); Bus::assertDispatched(SendDiscordNotificationJob::class); }); test('feature deleted sends discord notification', function () { $feature = FeatureModel::factory()->createOne(); Feature::activate(FeatureConstants::ALLOW_DISCORD_NOTIFICATIONS); Bus::fake(SendDiscordNotificationJob::class); Event::fakeExcept(FeatureDeleted::class); $feature->delete(); Bus::assertDispatched(SendDiscordNotificationJob::class); }); test('feature updated sends discord notification', function () { $feature = FeatureModel::factory()->createOne(); Feature::activate(FeatureConstants::ALLOW_DISCORD_NOTIFICATIONS); Bus::fake(SendDiscordNotificationJob::class); Event::fakeExcept(FeatureUpdated::class); $feature->update([ FeatureModel::ATTRIBUTE_VALUE => ! $feature->value, ]); Bus::assertDispatched(SendDiscordNotificationJob::class); });