- Settings (#/settings): API tokens (mint/list/revoke), Agents list, Orthos Mode placeholder - Per-space Projects: Void-1-style expandable cards — inline status, ↻ Research (Eithan stub), Edit/New modal, Delete-with-confirm; migration 019 adds research_status/notes/timestamps; POST /api/projects/:id/research stub; GET /api/agent-tokens list - Global +1 font bump; themed scrollbars; larger/bolder themed topbar Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
31 lines
1.3 KiB
JavaScript
31 lines
1.3 KiB
JavaScript
import { describe, it, expect, beforeAll } from 'vitest';
|
|
import request from 'supertest';
|
|
import { pool } from '../../lib/db/pool.js';
|
|
import { setup } from './helpers.js';
|
|
|
|
let app, ownerHeaders, projectId;
|
|
beforeAll(async () => {
|
|
({ app, ownerHeaders } = await setup());
|
|
const { rows: [s] } = await pool.query(`INSERT INTO spaces(slug,name) VALUES('p','P') RETURNING id`);
|
|
const { rows: [p] } = await pool.query(
|
|
`INSERT INTO projects(space_id,slug,name,status) VALUES($1,'proj','Proj','active') RETURNING id`, [s.id]);
|
|
projectId = p.id;
|
|
});
|
|
|
|
describe('project research stub', () => {
|
|
it('defaults research_status to none', async () => {
|
|
const { rows: [p] } = await pool.query(`SELECT research_status FROM projects WHERE id=$1`, [projectId]);
|
|
expect(p.research_status).toBe('none');
|
|
});
|
|
it('POST /research → requested (owner)', async () => {
|
|
const res = await request(app).post(`/api/projects/${projectId}/research`).set(ownerHeaders);
|
|
expect(res.status).toBe(200);
|
|
expect(res.body.research_status).toBe('requested');
|
|
expect(res.body.research_requested_at).toBeTruthy();
|
|
});
|
|
it('404 for an unknown project', async () => {
|
|
const res = await request(app).post(`/api/projects/00000000-0000-0000-0000-000000000000/research`).set(ownerHeaders);
|
|
expect(res.status).toBe(404);
|
|
});
|
|
});
|