2026-07-10 01:02:27 +02:00
|
|
|
|
import { describe, it, expect } from "vitest";
|
|
|
|
|
|
import { readFileSync } from "node:fs";
|
|
|
|
|
|
import { resolve } from "node:path";
|
|
|
|
|
|
|
2026-07-10 22:28:26 +02:00
|
|
|
|
describe("Kontakt Page (prototype port)", () => {
|
2026-07-10 01:02:27 +02:00
|
|
|
|
const pagePath = resolve(__dirname, "../../pages/kontakt.vue");
|
|
|
|
|
|
const content = readFileSync(pagePath, "utf-8");
|
|
|
|
|
|
|
|
|
|
|
|
it("should have page title Kontakt", () => {
|
|
|
|
|
|
expect(content).toContain("Kontakt");
|
|
|
|
|
|
});
|
|
|
|
|
|
|
2026-07-10 22:28:26 +02:00
|
|
|
|
it("should have office address card with Leipheim", () => {
|
2026-07-10 01:02:27 +02:00
|
|
|
|
expect(content).toContain("Grockelhofen 10");
|
|
|
|
|
|
expect(content).toContain("89340 Leipheim");
|
|
|
|
|
|
});
|
|
|
|
|
|
|
2026-07-10 22:28:26 +02:00
|
|
|
|
it("should have warehouse address with Ellzee", () => {
|
|
|
|
|
|
expect(content).toContain("Zur Schönhalde 8");
|
|
|
|
|
|
expect(content).toContain("89352 Ellzee");
|
2026-07-10 01:02:27 +02:00
|
|
|
|
});
|
|
|
|
|
|
|
2026-07-10 22:28:26 +02:00
|
|
|
|
it("should have opening hours", () => {
|
2026-07-10 01:02:27 +02:00
|
|
|
|
expect(content).toContain("Öffnungszeiten");
|
2026-07-10 22:28:26 +02:00
|
|
|
|
expect(content).toContain("10:00 – 18:00");
|
2026-07-10 01:02:27 +02:00
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
it("should have 2 contact persons", () => {
|
2026-07-10 22:28:26 +02:00
|
|
|
|
expect(content).toContain("Leopold Hammerschmidt");
|
|
|
|
|
|
expect(content).toContain("Andreas Mössle");
|
2026-07-10 01:02:27 +02:00
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
it("should have form with name field (required)", () => {
|
2026-07-10 22:28:26 +02:00
|
|
|
|
expect(content).toContain('id="name"');
|
|
|
|
|
|
expect(content).toContain("Name");
|
2026-07-10 01:02:27 +02:00
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
it("should have form with email field (required)", () => {
|
2026-07-10 22:28:26 +02:00
|
|
|
|
expect(content).toContain('id="email"');
|
|
|
|
|
|
expect(content).toContain("E-Mail");
|
2026-07-10 01:02:27 +02:00
|
|
|
|
});
|
|
|
|
|
|
|
2026-07-10 22:28:26 +02:00
|
|
|
|
it("should have form with phone field", () => {
|
|
|
|
|
|
expect(content).toContain('id="phone"');
|
2026-07-10 01:02:27 +02:00
|
|
|
|
expect(content).toContain("Telefon");
|
|
|
|
|
|
});
|
|
|
|
|
|
|
2026-07-10 22:28:26 +02:00
|
|
|
|
it("should have form with subject select", () => {
|
|
|
|
|
|
expect(content).toContain('id="subject"');
|
|
|
|
|
|
expect(content).toContain("Anliegen");
|
2026-07-10 01:02:27 +02:00
|
|
|
|
});
|
|
|
|
|
|
|
2026-07-10 22:28:26 +02:00
|
|
|
|
it("should have form with message textarea (required)", () => {
|
|
|
|
|
|
expect(content).toContain('id="message"');
|
|
|
|
|
|
expect(content).toContain("Nachricht");
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
it("should have privacy consent checkbox", () => {
|
2026-07-10 01:02:27 +02:00
|
|
|
|
expect(content).toContain('type="checkbox"');
|
|
|
|
|
|
expect(content).toContain("Datenschutzerklärung");
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
it("should have submit button", () => {
|
2026-07-10 22:28:26 +02:00
|
|
|
|
expect(content).toContain("Nachricht senden");
|
|
|
|
|
|
expect(content).toContain("hms-btn-primary");
|
2026-07-10 01:02:27 +02:00
|
|
|
|
});
|
|
|
|
|
|
|
2026-07-10 22:28:26 +02:00
|
|
|
|
it("should have email validation", () => {
|
|
|
|
|
|
expect(content).toContain("validate");
|
2026-07-10 01:02:27 +02:00
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
it("should have success state", () => {
|
2026-07-10 22:28:26 +02:00
|
|
|
|
expect(content).toContain("Nachricht übermittelt");
|
2026-07-10 01:02:27 +02:00
|
|
|
|
expect(content).toContain("Vielen Dank");
|
|
|
|
|
|
});
|
|
|
|
|
|
|
2026-07-10 22:28:26 +02:00
|
|
|
|
it("should have hms-input class", () => {
|
|
|
|
|
|
expect(content).toContain("hms-input");
|
2026-07-10 01:02:27 +02:00
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
it("should use TypeScript with lang=ts", () => {
|
|
|
|
|
|
expect(content).toContain('<script setup lang="ts">');
|
|
|
|
|
|
});
|
|
|
|
|
|
});
|