Create tests for app/Models/EntryTotalScore

This commit is contained in:
Matt Young 2025-07-03 14:22:17 -05:00
parent 899299fd99
commit fe9c3612be
1 changed files with 22 additions and 0 deletions

View File

@ -0,0 +1,22 @@
<?php
use App\Models\EntryTotalScore;
use Illuminate\Foundation\Testing\RefreshDatabase;
uses(RefreshDatabase::class);
beforeEach(function () {
$this->entry = \App\Models\Entry::factory()->create();
});
test('can return its entry', function () {
DB::table('entry_total_scores')->insert([
'entry_id' => $this->entry->id,
'seating_total' => 3,
'advancement_total' => 4,
'seating_subscore_totals' => json_encode([22, 2]),
'advancement_subscore_totals' => json_encode([22, 2]),
'bonus_total' => null,
]);
expect(EntryTotalScore::first()->entry->id)->toEqual($this->entry->id);
});