feat: user notification channels (monicahq/chandler#43)

This commit is contained in:
Regis Freyd
2022-02-24 14:24:33 -05:00
committed by GitHub
parent d9a6ec1c35
commit ac4d3df310
126 changed files with 3134 additions and 628 deletions
@@ -0,0 +1,32 @@
<?php
namespace Tests\Unit\Models;
use Tests\TestCase;
use App\Models\UserNotificationSent;
use App\Models\UserNotificationChannel;
use Illuminate\Foundation\Testing\DatabaseTransactions;
class UserNotificationChannelTest extends TestCase
{
use DatabaseTransactions;
/** @test */
public function it_has_one_user()
{
$channel = UserNotificationChannel::factory()->create();
$this->assertTrue($channel->user()->exists());
}
/** @test */
public function it_has_many_notification_sent(): void
{
$channel = UserNotificationChannel::factory()->create();
UserNotificationSent::factory()->count(2)->create([
'user_notification_channel_id' => $channel->id,
]);
$this->assertTrue($channel->userNotificationSent()->exists());
}
}