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