createOne(); Bus::assertDispatched(SendDiscordNotificationJob::class); }); test('external profile deleted sends discord notification', function (): void { $profile = ExternalProfile::factory()->createOne(); Feature::activate(FeatureConstants::ALLOW_DISCORD_NOTIFICATIONS); Bus::fake(SendDiscordNotificationJob::class); Event::fakeExcept(ExternalProfileDeleted::class); $profile->delete(); Bus::assertNotDispatched(SendDiscordNotificationJob::class); }); test('external profile updated sends discord notification', function (): void { $profile = ExternalProfile::factory()->createOne(); Feature::activate(FeatureConstants::ALLOW_DISCORD_NOTIFICATIONS); Bus::fake(SendDiscordNotificationJob::class); Event::fakeExcept(ExternalProfileUpdated::class); $changes = ExternalProfile::factory()->makeOne(); $profile->fill($changes->getAttributes()); $profile->save(); Bus::assertNotDispatched(SendDiscordNotificationJob::class); });