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