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