Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

test: exercise generic 3D installs over POST (#6936)

[._.]/ Adam Eivy2cda2d2957d1
diff --git a/server/routes/imageTo3d.genericDispatch.test.js b/server/routes/imageTo3d.genericDispatch.test.js
index a16c123a83..581ff5b151 100644
--- a/server/routes/imageTo3d.genericDispatch.test.js
+++ b/server/routes/imageTo3d.genericDispatch.test.js
@@ -89,8 +89,8 @@ describe('image-to-3d generic target dispatch (#3080)', () => {
expect(res.body.targets[0]).toMatchObject({ installed: true, fakeDiag: 'ok' });
});
- it('GET /targets/:targetId/install dispatches to the registered adapter', async () => {
- const res = await request(makeApp()).get('/api/image-to-3d/targets/fakegen/install');
+ it('POST /targets/:targetId/install dispatches to the registered adapter', async () => {
+ const res = await request(makeApp()).post('/api/image-to-3d/targets/fakegen/install');
const frames = sseFrames(res.text);
expect(frames).toContainEqual({ type: 'stage', stage: 'fake-step', message: 'installing FakeGen…' });
expect(frames.at(-1)).toMatchObject({ type: 'complete' });
@@ -101,14 +101,18 @@ describe('image-to-3d generic target dispatch (#3080)', () => {
// dispatch-layer assumption that every target wants a Hugging Face token —
// a target that declares no `resolveEnv` must never trigger one.
it('never resolves the Hugging Face token env for a target with no resolveEnv hook', async () => {
- await request(makeApp()).get('/api/image-to-3d/targets/fakegen/install');
+ await request(makeApp()).post('/api/image-to-3d/targets/fakegen/install');
expect(hfChildEnv).not.toHaveBeenCalled();
expect(fakeInstall).toHaveBeenCalledWith(expect.objectContaining({ env: undefined }));
});
it('errors on install for a target id with no registered adapter', async () => {
- const res = await request(makeApp()).get('/api/image-to-3d/targets/nope/install');
- const frames = sseFrames(res.text);
- expect(frames.at(-1)).toMatchObject({ type: 'error', message: expect.stringMatching(/Unknown/) });
+ const res = await request(makeApp()).post('/api/image-to-3d/targets/nope/install');
+ expect(res.status).toBe(400);
+ expect(res.body).toMatchObject({
+ error: expect.stringMatching(/Unknown/),
+ code: 'IMAGE_TO_3D_TARGET_NOT_INSTALLABLE',
+ timestamp: expect.any(Number),
+ });
});
});