PM-Liste: Hinweis auf laufende Boost-Platzierung unter dem Status

Badge "Boost bis TT.MM.JJJJ" in der Status-Spalte; Boost-Enden der
Seite in einer Query aggregiert statt isBoosted() je Zeile.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Kevin Adametz 2026-07-10 17:11:38 +00:00
parent bbcdc72e2f
commit 927523ca63
2 changed files with 51 additions and 0 deletions

View file

@ -1,6 +1,7 @@
<?php
use App\Enums\PressReleaseClassification;
use App\Models\Boost;
use App\Models\Category;
use App\Models\Company;
use App\Models\PressRelease;
@ -181,6 +182,36 @@ test('a boost without enough credits opens the shortfall modal instead of bookin
expect($pr->fresh()->isBoosted())->toBeFalse();
});
test('the press release list shows a hint with end date for an active boost', function () {
/** @var TestCase $this */
['customer' => $customer, 'pr' => $pr] = publishedGreenPrForOwner();
$this->wallet->credit($customer, 40);
$this->actingAs($customer);
LivewireVolt::test('customer.press-releases.index')
->assertDontSee('Boost bis');
Boost::factory()->for($pr)->create([
'ends_at' => now()->addDays(7)->setTime(9, 0),
]);
LivewireVolt::test('customer.press-releases.index')
->assertSee('Boost bis '.now()->addDays(7)->format('d.m.Y'));
});
test('an expired boost shows no hint in the press release list', function () {
/** @var TestCase $this */
['customer' => $customer, 'pr' => $pr] = publishedGreenPrForOwner();
$this->actingAs($customer);
Boost::factory()->for($pr)->expired()->create();
LivewireVolt::test('customer.press-releases.index')
->assertDontSee('Boost bis');
});
test('a non-green release cannot be boosted from the detail page', function () {
/** @var TestCase $this */
['customer' => $customer, 'pr' => $pr] = publishedGreenPrForOwner();