feat(ui): Settings view + per-space project cards (status/research/edit/delete) + theming pass
- 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>
This commit is contained in:
30
tests/api/project_research.test.js
Normal file
30
tests/api/project_research.test.js
Normal file
@@ -0,0 +1,30 @@
|
||||
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);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user