refactor: replace custom CRM with Monica fork
Some checks failed
Build & Push Monica Image to Gitea Registry / build-and-push (push) Failing after 9s

This commit is contained in:
Kroonk
2026-05-22 16:19:55 +02:00
parent 38cc4c09ca
commit a213a1dba0
2215 changed files with 242567 additions and 6015 deletions

View File

@@ -0,0 +1,48 @@
<?php
namespace Tests\Unit\Models;
use Tests\TestCase;
use App\Models\Instance\Emotion\Emotion;
use App\Models\Instance\Emotion\PrimaryEmotion;
use App\Models\Instance\Emotion\SecondaryEmotion;
use Illuminate\Foundation\Testing\DatabaseTransactions;
class EmotionTest extends TestCase
{
use DatabaseTransactions;
/** @test */
public function emotion_belongs_to_a_primary_emotion()
{
$emotion = factory(Emotion::class)->create([]);
$this->assertTrue($emotion->primary->exists());
$this->assertTrue($emotion->secondary->exists());
}
/** @test */
public function secondary_emotion_belongs_to_a_primary_emotion()
{
$secondaryEmotion = factory(SecondaryEmotion::class)->create([]);
$this->assertTrue($secondaryEmotion->primary->exists());
}
/** @test */
public function a_primary_emotion_has_multiple_emotions()
{
$primaryEmotion = factory(PrimaryEmotion::class)->create([]);
$secondaryEmotion = factory(SecondaryEmotion::class)->create([
'emotion_primary_id' => $primaryEmotion->id,
]);
factory(Emotion::class, 3)->create([
'emotion_primary_id' => $primaryEmotion->id,
'emotion_secondary_id' => $secondaryEmotion->id,
]);
$this->assertTrue($primaryEmotion->secondaries()->exists());
$this->assertTrue($primaryEmotion->emotions()->exists());
}
}