Update DoublerService test
This commit is contained in:
parent
7fc8914682
commit
1501764a51
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue