Include the last day of a date range in expense and time entry queries
SQLite stores date casts as "Y-m-d 00:00:00", so a between ending at "Y-m-d" left out the month's last day and the week's Sunday (the own expenses test failed on the 30th). Ranges now end before the next day. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -178,3 +178,15 @@ it('links the job page to its expenses and shows the own expenses by month', fun
|
||||
->assertSee('Lokakuu 2026')
|
||||
->assertSee('Lokakuun hankinta');
|
||||
});
|
||||
|
||||
it('lists an expense of the month\'s last day on the own expenses page', function () {
|
||||
$user = User::factory()->create();
|
||||
ExpenseModel::factory()->create(['customer_job_id' => $this->job->id, 'user_id' => $user->id, 'description' => 'Helmikuun viimeinen hankinta', 'spent_on' => '2026-02-28']);
|
||||
ExpenseModel::factory()->create(['customer_job_id' => $this->job->id, 'user_id' => $user->id, 'description' => 'Maaliskuun hankinta', 'spent_on' => '2026-03-01']);
|
||||
|
||||
$this->actingAs($user)
|
||||
->get(route('expenses.mine', ['kuukausi' => '2026-02']))
|
||||
->assertOk()
|
||||
->assertSee('Helmikuun viimeinen hankinta')
|
||||
->assertDontSee('Maaliskuun hankinta');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user