Passe Tests an die abgeleitete Produktseite und den Kaufpreis als Pflicht an
CI Feature / test (push) Successful in 5m15s
Deploy Test / test (push) Successful in 5m20s
Deploy Test / deploy (push) Successful in 31s

CatalogRulesTest: Angebote ohne Preis und Vergabe nutzten den Standard „Kauf“; sie geben jetzt
Preis oder die Vergabe „auf Abruf“ an, weil ein Kauf ohne Preis nicht aktiviert wird (ADR-52).
CartTest, OfferOptionAdminTest: Die Seite einer Option kommt aus ProductOptions::pageUrl; die
Auswahl „Produktseite“ gibt es nicht mehr. Keine Assertion wurde abgeschwächt.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
LarsandClaude Sonnet 5.5 committed 2026-11-25 18:07:55 +01:00
1 parent 08f7d0c63d
commit cce22ebd81
3 files changed
+10 -5

No files matched your search

+4 -2
View File
@@ -10,12 +10,14 @@
use App\Domain\Commerce\CartLine;
use App\Domain\Commerce\Checkout;
use App\Domain\Commerce\Order;
use App\Domain\Commerce\ProductOptions;
use App\Domain\Commerce\StaleOverview;
use App\Domain\Entitlement\GrantIssuer;
use App\Models\User;
use App\Notifications\VerifyEmailAddress;
use Database\Seeders\ShopDemoSeeder;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Notification;
use Illuminate\Support\Facades\URL;
use Tests\Support\BuildsShop;
@@ -40,7 +42,7 @@ public function test_a_guest_fills_the_cart_and_the_same_option_is_one_position(
{
$offer = $this->privateKonflikte();
$this->post(route('cart.add', $offer))->assertRedirect(route('public.program', $offer->composition_id));
$this->post(route('cart.add', $offer))->assertRedirect(app(ProductOptions::class)->pageUrl($offer));
$this->post(route('cart.add', $offer))->assertSessionHas('status');
$this->assertSame(1, app(Cart::class)->count());
@@ -75,7 +77,7 @@ public function test_alternative_options_of_one_product_page_are_replaced_only_a
$this->assertFalse(app(Cart::class)->has($club));
$this->withSession(['shop.switch' => $club->id])
->get(route('public.program', $club->composition_id))
->get(app(ProductOptions::class)->pageUrl($club))
->assertSee('Optionen wechseln?')
->assertSee('Zu „Mehrfachlizenz für Vereine“ wechseln')
->assertSee('Bei „Privatlizenz“ bleiben');
+3 -1
View File
@@ -187,6 +187,7 @@ public function test_h_a_bundle_change_does_not_change_an_activated_offer(): voi
$offer = app(OfferService::class)->activate(
app(OfferService::class)->create('Programmangebot'),
[['target' => $published, 'rights' => $rights]],
['grant_kind' => 'kauf', 'price_cents' => 1000],
);
$bundles->publish($bundle, [$first, $second]);
@@ -213,6 +214,7 @@ public function test_publication_records_impact_and_withdrawal_restores_the_prev
app(OfferService::class)->activate(
app(OfferService::class)->create('Blattangebot'),
[['target' => $article, 'rights' => $rights]],
['grant_kind' => 'kauf', 'price_cents' => 1000],
);
$party = Party::query()->create([
'type' => PartyType::Person,
@@ -265,7 +267,7 @@ public function test_each_holder_gets_an_own_acquisition_and_one_grant_per_artic
$offer = app(OfferService::class)->create('Kostenlos');
app(OfferService::class)->activate($offer, [
['target' => $article, 'rights' => $rights],
]);
], ['grant_kind' => 'auf_abruf']);
$acquisitions = [];
+3 -2
View File
@@ -5,6 +5,7 @@
use App\Domain\Catalog\OfferStatus;
use App\Domain\Commerce\Cart;
use App\Domain\Commerce\CartLine;
use App\Domain\Commerce\ProductOptions;
use App\Filament\Resources\Offers\Pages\ListOffers;
use App\Filament\Resources\Offers\Pages\ViewOffer;
use App\Models\User;
@@ -78,7 +79,7 @@ public function test_the_mask_is_prefilled_names_the_option_and_states_the_effec
$this->assertStringContainsString('„Abbrechen“ verwirft die Eingaben', $description);
$this->assertSame('Fassung 2 aktivieren', $action->getModalSubmitActionLabel());
$this->assertSame('Privatlizenz', $data['option_label']);
$this->assertSame((string) $offer->composition_id, (string) $data['composition_id']);
$this->assertArrayNotHasKey('composition_id', $data, 'Die Produktseite wird nicht mehr zugeordnet, sie ergibt sich aus dem Artikel.');
$this->assertSame('person', $data['holder_kind']);
$this->assertSame('kauf', $data['grant_kind']);
$this->assertSame('49,00', $data['price_euro'], 'Der Preis steht in Euro, nicht in Cent.');
@@ -125,7 +126,7 @@ public function test_activating_changes_only_this_option_and_leaves_the_others_p
$this->assertSame(1, $untouched->versions()->count());
$this->assertNotNull(app(Cart::class)->purchasable($untouched));
}
$this->get(route('public.program', $offer->composition_id))
$this->get(app(ProductOptions::class)->pageUrl($offer))
->assertSee('39,00 €')
->assertSee('Privatlizenz (neu)')
->assertSee('149,00 €');