implement/init e2e tests (#135)

* init e2e

* updated/moved vitest, finished merge

* fix bun picking up e2e tests

* e2e: overwrite webserver config with env

* e2e: added adapter configs

* e2e: replaced image
This commit is contained in:
dswbx
2025-04-03 11:08:16 +02:00
committed by GitHub
parent 0b41aa5a2d
commit fa6c7acaf5
16 changed files with 365 additions and 78 deletions

View File

@@ -18,6 +18,7 @@ import { Controller } from "modules/Controller";
import {
MODULE_NAMES,
type ModuleConfigs,
type ModuleSchemas,
type ModuleKey,
getDefaultConfig,
} from "modules/ModuleManager";
@@ -36,6 +37,12 @@ export type ConfigUpdate<Key extends ModuleKey = ModuleKey> = {
export type ConfigUpdateResponse<Key extends ModuleKey = ModuleKey> =
| ConfigUpdate<Key>
| { success: false; type: "type-invalid" | "error" | "unknown"; error?: any; errors?: any };
export type SchemaResponse = {
version: string;
schema: ModuleSchemas;
config: ModuleConfigs;
permissions: string[];
};
export class SystemController extends Controller {
constructor(private readonly app: App) {

View File

@@ -36,6 +36,7 @@ export type BaseProps = {
size?: keyof typeof sizes;
variant?: keyof typeof styles;
labelClassName?: string;
"data-testid"?: string;
};
const Base = ({

8
app/src/ui/lib/config.ts Normal file
View File

@@ -0,0 +1,8 @@
export const config = {};
export const testIds = {
data: {
btnCreateEntity: "data-btns-create-entity",
},
media: {},
};

View File

@@ -21,6 +21,7 @@ import { Link, isLinkActive } from "ui/components/wouter/Link";
import { useBrowserTitle } from "ui/hooks/use-browser-title";
import * as AppShell from "ui/layouts/AppShell/AppShell";
import { routes, useNavigate, useRouteNavigate } from "ui/lib/routes";
import { testIds } from "ui/lib/config";
export function DataRoot({ children }) {
// @todo: settings routes should be centralized
@@ -269,6 +270,7 @@ export function DataEmpty() {
}}
primary={{
children: "Create entity",
"data-testid": testIds.data.btnCreateEntity,
onClick: $data.modals.createEntity,
}}
/>

View File

@@ -139,6 +139,7 @@ function Adapters() {
<Button
key={i}
onClick={() => ctx.select(i)}
id={`adapter-${schema.properties.type.const}`}
variant={ctx.selected === i ? "primary" : "outline"}
className={twMerge(
"flex flex-row items-center justify-center gap-3 border",