Files
chat/e2e/setup/users.mock.ts
zeekayandHanzo Dev 8e77d7828c e2e: a credential-free mock harness, so the suite can run without a live stack
The second half of the same uncommitted 2026-07-27 session. It lets the
playwright suite run against fakes instead of a real deployment: an in-process
fake model (setup/fake-model.js), fake MCP servers over stdio and HTTP, a
tool-approval hook, mock users and fixtures, and specs/mock/ that exercise them.
playwright.config.mock.ts wires it together and is the entry point.

.generated/chat.e2e.yaml is committed deliberately despite the directory name:
it is a credential-free TEMPLATE that playwright.config.mock.ts copies to an
ignored runtime path, and the fake model overrides the endpoint every run, so
the placeholder baseURL in it is never contacted. It is input to the harness,
not output of it — the directory is misleadingly named, which is worth knowing
before someone adds it to .gitignore and breaks the mock run.

packages/api/src/agents/testHook.ts rides along: it is test-only infrastructure
from the same work. Nothing in tracked source imports it (the reference in
packages/api/dist/ is from a stale build, and the tracked agents/index.ts does
not export it), so it is inert until something opts in.

Not run here: this checkout cannot execute the suite — @hanzochat/data-provider
is not linked into node_modules, which already breaks tracked tests. Committed
so the work stops living only on one disk; whoever has a complete workspace can
exercise it.

Co-authored-by: Hanzo Dev <[email protected]>
2026-08-03 08:26:06 -07:00

21 lines
569 B
TypeScript

import type { User } from '../types';
import { getE2EUser } from './user';
const DEFAULT_SECONDARY_USER: User = {
email: '[email protected]',
name: 'Test User B',
password: 'securepassword456',
};
export function getPrimaryE2EUser(): User {
return getE2EUser();
}
export function getSecondaryE2EUser(): User {
return {
email: process.env.E2E_USER_B_EMAIL ?? DEFAULT_SECONDARY_USER.email,
name: process.env.E2E_USER_B_NAME ?? DEFAULT_SECONDARY_USER.name,
password: process.env.E2E_USER_B_PASSWORD ?? DEFAULT_SECONDARY_USER.password,
};
}