Initial commit
Deploy / validate-dispatch (push) Successful in 43s
Deploy / scheduled-rebuild-dev (push) Skipped
Deploy / scheduled-rebuild-master (push) Skipped
Deploy / rollback-dev (push) Skipped
Deploy / rollback-master (push) Skipped
Deploy / changes (push) Successful in 13s
Deploy / secret-scan (push) Successful in 9s
Deploy / app-quality (push) Successful in 11m21s
Deploy / security-deps (push) Successful in 14s
Deploy / context (push) Failing after 1s
Deploy / app-image (push) Skipped
Deploy / deploy-dev (push) Skipped
Deploy / deploy-master (push) Skipped
Deploy / validate-dispatch (push) Successful in 43s
Deploy / scheduled-rebuild-dev (push) Skipped
Deploy / scheduled-rebuild-master (push) Skipped
Deploy / rollback-dev (push) Skipped
Deploy / rollback-master (push) Skipped
Deploy / changes (push) Successful in 13s
Deploy / secret-scan (push) Successful in 9s
Deploy / app-quality (push) Successful in 11m21s
Deploy / security-deps (push) Successful in 14s
Deploy / context (push) Failing after 1s
Deploy / app-image (push) Skipped
Deploy / deploy-dev (push) Skipped
Deploy / deploy-master (push) Skipped
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
import http from "node:http";
|
||||
|
||||
const port = Number(process.env.FIXTURE_PORT ?? 3101);
|
||||
const start = new Date(Date.now() + 7 * 24 * 60 * 60 * 1_000);
|
||||
const end = new Date(start.getTime() + 2 * 60 * 60 * 1_000);
|
||||
|
||||
function icsDate(date) {
|
||||
return date.toISOString().replace(/[-:]/g, "").replace(/\.\d{3}Z$/, "Z");
|
||||
}
|
||||
|
||||
const calendar = `BEGIN:VCALENDAR\r
|
||||
VERSION:2.0\r
|
||||
PRODID:-//Website Starter E2E//DE\r
|
||||
BEGIN:VEVENT\r
|
||||
UID:e2e-special-event\r
|
||||
SUMMARY:E2E Beispieltermin\r
|
||||
LOCATION:Beispielort\r
|
||||
DTSTART:${icsDate(start)}\r
|
||||
DTEND:${icsDate(end)}\r
|
||||
END:VEVENT\r
|
||||
END:VCALENDAR\r
|
||||
`;
|
||||
|
||||
const server = http.createServer((_request, response) => {
|
||||
response.writeHead(200, { "content-type": "text/calendar; charset=utf-8" });
|
||||
response.end(calendar);
|
||||
});
|
||||
|
||||
server.listen(port, "127.0.0.1", () => {
|
||||
console.log(`ICS fixture listening on http://127.0.0.1:${port}`);
|
||||
});
|
||||
|
||||
for (const signal of ["SIGINT", "SIGTERM"]) {
|
||||
process.on(signal, () => server.close(() => process.exit(0)));
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
import assert from "node:assert/strict";
|
||||
import { describe, it } from "node:test";
|
||||
|
||||
const baseUrl = process.env.E2E_BASE_URL ?? "http://127.0.0.1:3100";
|
||||
|
||||
async function readPage(pathname) {
|
||||
const response = await fetch(`${baseUrl}${pathname}`);
|
||||
assert.equal(response.status, 200);
|
||||
return response.text();
|
||||
}
|
||||
|
||||
describe("Next.js production server", () => {
|
||||
it("renders the homepage with the main hero copy", async () => {
|
||||
const html = await readPage("/");
|
||||
|
||||
assert.match(html, /Bereit für Ihre neue Website/);
|
||||
assert.match(html, /E2E Beispieltermin/);
|
||||
});
|
||||
|
||||
it("server-renders current calendar content", async () => {
|
||||
const html = await readPage("/kalender/");
|
||||
|
||||
assert.match(html, /E2E Beispieltermin/);
|
||||
assert.match(html, /Beispielort/);
|
||||
});
|
||||
|
||||
it("renders the information page without client-side placeholders", async () => {
|
||||
const html = await readPage("/informationen/");
|
||||
|
||||
assert.match(html, /Informationsbereiche/);
|
||||
assert.doesNotMatch(html, /href="#"/);
|
||||
});
|
||||
|
||||
it("serves the calendar API with cache validation", async () => {
|
||||
const response = await fetch(`${baseUrl}/api/events`, { redirect: "manual" });
|
||||
assert.equal(response.status, 200);
|
||||
const events = await response.json();
|
||||
assert.equal(events[0].title, "E2E Beispieltermin");
|
||||
assert.match(response.headers.get("cache-control") ?? "", /stale-while-revalidate/);
|
||||
const etag = response.headers.get("etag");
|
||||
assert.ok(etag);
|
||||
|
||||
const cached = await fetch(`${baseUrl}/api/events`, {
|
||||
headers: { "if-none-match": etag },
|
||||
});
|
||||
assert.equal(cached.status, 304);
|
||||
});
|
||||
|
||||
it("reports liveness and calendar readiness", async () => {
|
||||
const live = await fetch(`${baseUrl}/health/live`);
|
||||
assert.equal(live.status, 200);
|
||||
assert.deepEqual(await live.json(), { status: "ok" });
|
||||
|
||||
const ready = await fetch(`${baseUrl}/health/ready`);
|
||||
assert.equal(ready.status, 200);
|
||||
assert.deepEqual(await ready.json(), { status: "ok", reason: null });
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user