for(Anime::factory()) ->createOne(); Feature::activate(FeatureConstants::ALLOW_DISCORD_NOTIFICATIONS); Bus::fake(SendDiscordNotificationJob::class); Http::fake(); Event::fakeExcept(DiscordThreadDeleted::class); $thread->delete(); Bus::assertDispatched(SendDiscordNotificationJob::class); }); test('thread updated sends discord notification', function () { $thread = DiscordThread::factory() ->for(Anime::factory()) ->createOne(); Feature::activate(FeatureConstants::ALLOW_DISCORD_NOTIFICATIONS); Bus::fake(SendDiscordNotificationJob::class); Http::fake(); Event::fakeExcept(DiscordThreadUpdated::class); $changes = DiscordThread::factory() ->for(Anime::factory()) ->makeOne(); $thread->fill($changes->getAttributes()); $thread->save(); Bus::assertDispatched(SendDiscordNotificationJob::class); });