feat: Sprint 1 — Playwright e2e + sandbox orchestration (TDD)
Mirror to GitHub / mirror (push) Canceled after 0s

- e2e: Playwright chat-flow (sign up -> chat) with api/web webServer harness
- api: sandbox services subset/media-proxy/manifest/gc + DockerClient contract
- api: SandboxManager orchestrator (fake-Docker tested); /health route
- 53 unit tests green; Playwright e2e green
This commit is contained in:
SinachPat
2026-08-15 20:01:58 +01:00
parent 9733ba6e3c
commit a037b882e9
17 changed files with 376 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
import { describe, it, expect } from 'vitest';
import { mediaProxyTarget, resolveMediaPath, stageReplacement } from '../../src/sandbox/media-proxy.ts';
describe('media proxy', () => {
it('proxies an upload to the origin', () => {
expect(mediaProxyTarget('https://example.com', '/wp-content/uploads/2024/hero.jpg')).toBe(
'https://example.com/wp-content/uploads/2024/hero.jpg',
);
});
it('serves a staged replacement locally instead of proxying', () => {
const staged = new Set(['/wp-content/uploads/2024/hero.jpg']);
expect(resolveMediaPath('https://example.com', '/wp-content/uploads/2024/hero.jpg', staged)).toBe(
'/wp-content/uploads/2024/hero.jpg',
);
expect(resolveMediaPath('https://example.com', '/wp-content/uploads/2024/other.jpg', staged)).toBe(
'https://example.com/wp-content/uploads/2024/other.jpg',
);
});
it('copies a file only when it is replaced', () => {
expect(stageReplacement('https://example.com', '/wp-content/uploads/2024/hero.jpg', 12)).toEqual({
copiedPaths: ['/wp-content/uploads/2024/hero.jpg'],
});
});
});