Add feature tests for shop functionality and organization purchases
Deploy Test / test (push) Successful in 1m38s
Deploy Test / deploy (push) Successful in 31s

- Implement OfferOptionAdminTest to validate offer option management, including price display, activation, and cancellation.
- Create OrganizationPurchaseTest to ensure correct handling of organization purchases, including access control and order processing.
- Add ShopProductPageTest to verify shop product listings, search functionality, and product page details.
- Introduce BuildsShop trait for seeding test data related to shop functionality.
- Implement MoneyTest to validate money parsing and formatting, ensuring correct handling of euro amounts.
This commit is contained in:
Lars committed 2026-11-21 12:06:24 +01:00
1 parent 6c8bbee363
commit 4e0760db1e
106 files changed
+4068 -76

No files matched your search

+9 -4
View File
@@ -135,6 +135,8 @@ public function test_public_page_is_identical_for_guests_and_members(): void
public function test_global_layout_has_header_navigation_mobile_menu_and_footer(): void
{
// Der Warenkorb gehört zum Shop (Etappe 1, nur Testzahlung). Ohne aktiven Shop erscheint kein Kaufknopf.
config(['services.payment.driver' => 'stripe']);
$html = $this->get('/praevention')->assertOk()->getContent();
$this->assertStringContainsString('<a class="skip" href="#inhalt">', $html);
@@ -148,16 +150,19 @@ public function test_global_layout_has_header_navigation_mobile_menu_and_footer(
$this->assertStringContainsString('class="site-footer scope-dark"', $html);
$this->assertStringContainsString('<h2 id="fuss-footer">Service</h2>', $html);
$this->assertStringContainsString('Impressum', $html);
$this->assertStringNotContainsString('Warenkorb', $html, 'Ohne Warenkorb erscheint kein funktionsloser Kaufknopf.');
$this->assertStringNotContainsString('Warenkorb', $html, 'Ohne aktiven Shop erscheint kein Kaufknopf.');
$this->assertStringNotContainsString('fonts.bunny.net', $html);
$this->assertStringNotContainsString('fonts.googleapis.com', $html);
}
public function test_cart_entry_appears_only_when_enabled(): void
public function test_cart_entry_appears_only_when_the_shop_is_enabled(): void
{
config(['cms.cart.enabled' => true, 'cms.cart.url' => '/warenkorb']);
// Seit Etappe 1 ist der Warenkorb umgesetzt: Der Eintrag folgt dem Shop (Testzahlung, nie Produktion)
// statt der früheren Vorbereitung über cms.cart.*.
$this->get('/praevention')->assertSee('Warenkorb')->assertSee('href="'.route('cart').'"', false);
$this->get('/praevention')->assertSee('Warenkorb')->assertSee('href="/warenkorb"', false);
config(['services.payment.driver' => 'stripe']);
$this->get('/praevention')->assertDontSee('Warenkorb');
}
public function test_submenus_footer_groups_and_hidden_parents(): void