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