createOne(); Bus::assertDispatched(SendDiscordNotificationJob::class); }); test('image deleted sends discord notification', function (): void { $image = Image::factory()->createOne(); Feature::activate(FeatureConstants::ALLOW_DISCORD_NOTIFICATIONS); Bus::fake(SendDiscordNotificationJob::class); Event::fakeExcept(ImageDeleted::class); $image->delete(); Bus::assertDispatched(SendDiscordNotificationJob::class); }); test('image restored sends discord notification', function (): void { $image = Image::factory()->createOne(); Feature::activate(FeatureConstants::ALLOW_DISCORD_NOTIFICATIONS); Bus::fake(SendDiscordNotificationJob::class); Event::fakeExcept(ImageRestored::class); $image->restore(); Bus::assertDispatched(SendDiscordNotificationJob::class); }); test('image updated sends discord notification', function (): void { $image = Image::factory()->createOne(); Feature::activate(FeatureConstants::ALLOW_DISCORD_NOTIFICATIONS); Bus::fake(SendDiscordNotificationJob::class); Event::fakeExcept(ImageUpdated::class); $changes = Image::factory()->makeOne(); $image->fill($changes->getAttributes()); $image->save(); Bus::assertDispatched(SendDiscordNotificationJob::class); });