Alpenwerk HR -- interne HR-Stammdatenverwaltung
Mitarbeiter:innen, Organisationsstruktur, Planstellen, Eintritt, Austritt, Versetzung, Befoerderung, Karenz, On- und Offboarding, Berichte, Massenimport und ein lueckenloser Nachweis jeder Aenderung. Next.js 16 mit React 19 und TypeScript, PostgreSQL 17 ueber Kysely, Anmeldung ueber Microsoft Entra ID. Die Fachlogik liegt in der Datenbank: rund dreissig PL/pgSQL-Funktionen fuehren eine Aenderung, ihren Historieneintrag und ihren Protokolleintrag in einer Transaktion aus. Die Zugriffsschranke ist Row Level Security, nicht die Oberflaeche. Betrieb auf Windows Server ohne Docker: ein fertiges Paket, ein Windows-Dienst, der IIS als HTTPS-Vorschaltung und zwei geplante Aufgaben. Siehe deploy/windows/README.md.
This commit is contained in:
46
tests/components/setup.ts
Normal file
46
tests/components/setup.ts
Normal file
@@ -0,0 +1,46 @@
|
||||
import "@testing-library/jest-dom/vitest";
|
||||
import { cleanup } from "@testing-library/react";
|
||||
import { afterEach, vi } from "vitest";
|
||||
|
||||
afterEach(cleanup);
|
||||
|
||||
// React Flow keeps a node at visibility:hidden until ResizeObserver has
|
||||
// reported its size, and Testing Library excludes hidden elements from the
|
||||
// accessibility tree — so an inert stub makes every node unqueryable by
|
||||
// role. This one reports a size, which is what actually makes the nodes
|
||||
// visible and the chart behave as it does in a browser.
|
||||
const NODE_WIDTH = 268;
|
||||
const NODE_HEIGHT = 80;
|
||||
|
||||
class ResizeObserverStub {
|
||||
constructor(private readonly callback: ResizeObserverCallback) {}
|
||||
observe(target: Element) {
|
||||
const entry = {
|
||||
target,
|
||||
contentRect: { width: NODE_WIDTH, height: NODE_HEIGHT, top: 0, left: 0, bottom: NODE_HEIGHT, right: NODE_WIDTH, x: 0, y: 0 },
|
||||
} as unknown as ResizeObserverEntry;
|
||||
queueMicrotask(() => this.callback([entry], this as unknown as ResizeObserver));
|
||||
}
|
||||
unobserve() {}
|
||||
disconnect() {}
|
||||
}
|
||||
vi.stubGlobal("ResizeObserver", ResizeObserverStub);
|
||||
|
||||
if (!("DOMMatrixReadOnly" in globalThis)) {
|
||||
class DOMMatrixReadOnlyStub {
|
||||
m22 = 1;
|
||||
}
|
||||
vi.stubGlobal("DOMMatrixReadOnly", DOMMatrixReadOnlyStub);
|
||||
}
|
||||
|
||||
// Not implemented by jsdom at all, and the comboboxes call it to keep the
|
||||
// highlighted row in view — an unstubbed call throws inside the effect and
|
||||
// takes the render down with it.
|
||||
if (!("scrollIntoView" in Element.prototype)) {
|
||||
Object.defineProperty(Element.prototype, "scrollIntoView", { configurable: true, value: () => {} });
|
||||
}
|
||||
|
||||
// jsdom reports 0 for every layout box; React Flow reads these to size nodes.
|
||||
Object.defineProperty(HTMLElement.prototype, "offsetWidth", { configurable: true, value: NODE_WIDTH });
|
||||
Object.defineProperty(HTMLElement.prototype, "offsetHeight", { configurable: true, value: NODE_HEIGHT });
|
||||
Object.defineProperty(SVGElement.prototype, "getBBox", { configurable: true, value: () => ({ x: 0, y: 0, width: 0, height: 0 }) });
|
||||
Reference in New Issue
Block a user