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