feat: Wabenhain Honig-Shop Anwendung
Vollstaendige Next.js/Prisma-E-Commerce-Anwendung fuer eine Imkerei: Shop, Warenkorb, Stripe-Checkout, Kundenkonto mit 2FA, Admin-Bereich (Produkte, Ernten, Chargen, Bestellungen, Gutscheine, admin-editierbare Website-Inhalte), i18n (DE/EN), Rate-Limiting/CSP/Audit-Log-Haertung, PostgreSQL- und MySQL-Unterstuetzung ueber austauschbare Prisma- Treiber-Adapter, Unit-/Komponenten-/E2E-Tests.
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
import { test, expect } from "@playwright/test";
|
||||
|
||||
test("checkout shows live shipping cost for Versand and switches to free for Abholung", async ({ page }) => {
|
||||
await page.goto("/honig/fruehtracht-2026");
|
||||
await page.getByRole("button", { name: "In den Warenkorb" }).first().click();
|
||||
|
||||
await page.goto("/checkout");
|
||||
|
||||
await expect(page.getByText("Zwischensumme")).toBeVisible();
|
||||
await expect(page.getByText("Gesamt")).toBeVisible();
|
||||
|
||||
// Versand ist per Default aktiv und zeigt eine Versandstaffel-Kosten
|
||||
// (nicht "kostenlos"), solange der Warenkorb unter der Freigrenze liegt.
|
||||
const summary = page.locator("aside");
|
||||
await expect(summary.getByText(/Versand/)).toBeVisible();
|
||||
|
||||
await page.getByRole("button", { name: "Abholung in Altenmünster" }).click();
|
||||
|
||||
await expect(summary.getByText("kostenlos")).toBeVisible();
|
||||
});
|
||||
|
||||
test("checkout requires street address only when Versand is selected", async ({ page }) => {
|
||||
await page.goto("/honig/fruehtracht-2026");
|
||||
await page.getByRole("button", { name: "In den Warenkorb" }).first().click();
|
||||
|
||||
await page.goto("/checkout");
|
||||
|
||||
await expect(page.getByLabel("Straße und Hausnummer")).toBeVisible();
|
||||
|
||||
await page.getByRole("button", { name: "Abholung in Altenmünster" }).click();
|
||||
|
||||
await expect(page.getByLabel("Straße und Hausnummer")).toHaveCount(0);
|
||||
});
|
||||
Reference in New Issue
Block a user