scoreService = new ScoreService(); }); it('can record a score', function () { // Arrange // run the seeder AuditionWithScoringGuideAndRoom artisan('db:seed', ['--class' => 'AuditionWithScoringGuideAndRoom']); // Act & Assert expect(Audition::find(1000)->name)->toBe('Test Audition'); }); it('can check if an entry is fully scored', function () { $room = Room::factory()->create(); $judges = User::factory()->count(2)->create(); $judges->each(fn ($judge) => $room->addJudge($judge)); $audition = Audition::factory()->create(['room_id' => $room->id]); $entry = Entry::factory()->create(['audition_id' => $audition->id]); expect($this->scoreService->isEntryFullyScored($entry))->toBeFalse(); ScoreSheet::create([ 'user_id' => $judges->first()->id, 'entry_id' => $entry->id, 'subscores' => 7, ]); expect($this->scoreService->isEntryFullyScored($entry))->toBeFalse(); ScoreSheet::create([ 'user_id' => $judges->last()->id, 'entry_id' => $entry->id, 'subscores' => 7, ]); expect($this->scoreService->isEntryFullyScored($entry))->toBeTrue(); });