createOne(); Bus::assertDispatched(SendDiscordNotificationJob::class); }); test('artist deleted sends discord notification', function () { $artist = Artist::factory()->createOne(); Feature::activate(FeatureConstants::ALLOW_DISCORD_NOTIFICATIONS); Bus::fake(SendDiscordNotificationJob::class); Event::fakeExcept(ArtistDeleted::class); $artist->delete(); Bus::assertDispatched(SendDiscordNotificationJob::class); }); test('artist restored sends discord notification', function () { $artist = Artist::factory()->createOne(); Feature::activate(FeatureConstants::ALLOW_DISCORD_NOTIFICATIONS); Bus::fake(SendDiscordNotificationJob::class); Event::fakeExcept(ArtistRestored::class); $artist->restore(); Bus::assertDispatched(SendDiscordNotificationJob::class); }); test('artist updated sends discord notification', function () { $artist = Artist::factory()->createOne(); Feature::activate(FeatureConstants::ALLOW_DISCORD_NOTIFICATIONS); Bus::fake(SendDiscordNotificationJob::class); Event::fakeExcept(ArtistUpdated::class); $changes = Artist::factory()->makeOne(); $artist->fill($changes->getAttributes()); $artist->save(); Bus::assertDispatched(SendDiscordNotificationJob::class); });