Skip to content

Commit

Permalink
failling test
Browse files Browse the repository at this point in the history
  • Loading branch information
edalzell committed Feb 14, 2024
1 parent dd6fdce commit fa053e9
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/Unit/RecurringEventsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,25 @@ public function canCreateRecurringEvent()
// $this->assertNull($event->endDate());
// $this->assertNull($event->end());
// }

/** @test */
public function canShowLastOccurrenceWhenNoEndTime()
{
Carbon::setTestNow(now()->setTimeFromTimeString('10:00'));

$recurringEntry = tap(Entry::make()
->collection('events')
->data([
'start_date' => Carbon::now()->addDays(1)->toDateString(),
'start_time' => '22:00',
'recurrence' => 'daily',
'end_date' => Carbon::now()->addDays(2)->toDateString(),
'timezone' => 'America/Chicago',
]))->save();

$occurrences = Events::fromCollection(handle: 'events')
->between(Carbon::now(), Carbon::now()->addDays(5)->endOfDay());

$this->assertCount(2, $occurrences);
}
}

0 comments on commit fa053e9

Please sign in to comment.