refactor: replace custom CRM with Monica fork
Some checks failed
Build & Push Monica Image to Gitea Registry / build-and-push (push) Failing after 9s
Some checks failed
Build & Push Monica Image to Gitea Registry / build-and-push (push) Failing after 9s
This commit is contained in:
76
tests/Unit/Models/LifeEventTest.php
Normal file
76
tests/Unit/Models/LifeEventTest.php
Normal file
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Unit\Models;
|
||||
|
||||
use Tests\TestCase;
|
||||
use App\Models\Contact\Reminder;
|
||||
use App\Models\Contact\LifeEvent;
|
||||
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||
|
||||
class LifeEventTest extends TestCase
|
||||
{
|
||||
use DatabaseTransactions;
|
||||
|
||||
/** @test */
|
||||
public function it_belongs_to_an_account()
|
||||
{
|
||||
$lifeEvent = factory(LifeEvent::class)->create([]);
|
||||
|
||||
$this->assertTrue($lifeEvent->account()->exists());
|
||||
}
|
||||
|
||||
/** @test */
|
||||
public function it_belongs_to_a_contact()
|
||||
{
|
||||
$lifeEvent = factory(LifeEvent::class)->create([]);
|
||||
|
||||
$this->assertTrue($lifeEvent->contact()->exists());
|
||||
}
|
||||
|
||||
/** @test */
|
||||
public function it_belongs_to_a_type()
|
||||
{
|
||||
$lifeEvent = factory(LifeEvent::class)->create([]);
|
||||
|
||||
$this->assertTrue($lifeEvent->lifeEventType()->exists());
|
||||
}
|
||||
|
||||
/** @test */
|
||||
public function it_has_a_reminder()
|
||||
{
|
||||
$lifeEvent = factory(LifeEvent::class)->create([]);
|
||||
$reminder = factory(Reminder::class)->create([
|
||||
'account_id' => $lifeEvent->account_id,
|
||||
]);
|
||||
$lifeEvent->reminder_id = $reminder->id;
|
||||
$lifeEvent->save();
|
||||
|
||||
$this->assertTrue($lifeEvent->reminder()->exists());
|
||||
}
|
||||
|
||||
/** @test */
|
||||
public function it_gets_the_name_attribute()
|
||||
{
|
||||
$lifeEvent = factory(LifeEvent::class)->create([
|
||||
'name' => 'Fake name',
|
||||
]);
|
||||
|
||||
$this->assertEquals(
|
||||
'Fake name',
|
||||
$lifeEvent->name
|
||||
);
|
||||
}
|
||||
|
||||
/** @test */
|
||||
public function it_gets_the_note_attribute()
|
||||
{
|
||||
$lifeEvent = factory(LifeEvent::class)->create([
|
||||
'note' => 'Fake note',
|
||||
]);
|
||||
|
||||
$this->assertEquals(
|
||||
'Fake note',
|
||||
$lifeEvent->note
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user