Update DoublerService test

This commit is contained in:
Matt Young 2024-07-13 23:27:13 -05:00
parent 7fc8914682
commit 1501764a51
2 changed files with 3 additions and 2 deletions

View File

@ -39,6 +39,7 @@ class DoublerService
*/
protected function findDoublersForEvent(Event $event, string $mode = 'seating'): array
{
// TODO add scoped entry queries to the event model
$this->validateEvent($event);
$entries = $event->entries()->with('audition')->with('student')->get();
$entries = match ($mode) {

View File

@ -67,12 +67,12 @@ it('returns doublers for an event', function () {
$return = $this->doublerService->doublersForEvent($concertEvent);
expect(count($return))->toBe(2)
->and($return[1000]['student']->id)->toBe($allSaxDude->id)
->and($return[1000]['student_id'])->toBe($allSaxDude->id)
->and($return[1000]['entries']->count())->toBe(3)
->and($return[1001]['entries']->count())->toBe(2);
assertArrayNotHasKey(1002, $return);
$return = $this->doublerService->doublersForEvent($jazzEvent);
expect(count($return))->toBe(1)
->and($return[1000]['student']->id)->toBe($allSaxDude->id)
->and($return[1000]['student_id'])->toBe($allSaxDude->id)
->and($return[1000]['entries']->count())->toBe(3);
});