fix(api): close v2 mobile contract gaps
This commit is contained in:
@@ -267,6 +267,25 @@ test('POST /core/rapid-orders/parse rejects unknown fields', async () => {
|
||||
assert.equal(res.body.code, 'VALIDATION_ERROR');
|
||||
});
|
||||
|
||||
test('POST /core/rapid-orders/process accepts text-only flow', async () => {
|
||||
const app = createApp();
|
||||
const res = await request(app)
|
||||
.post('/core/rapid-orders/process')
|
||||
.set('Authorization', 'Bearer test-token')
|
||||
.send({
|
||||
text: 'Need 2 servers ASAP for 4 hours',
|
||||
locale: 'en-US',
|
||||
timezone: 'America/New_York',
|
||||
now: '2026-02-27T12:00:00.000Z',
|
||||
});
|
||||
|
||||
assert.equal(res.status, 200);
|
||||
assert.equal(typeof res.body.transcript, 'string');
|
||||
assert.equal(res.body.parsed.orderType, 'ONE_TIME');
|
||||
assert.equal(Array.isArray(res.body.parsed.positions), true);
|
||||
assert.equal(Array.isArray(res.body.catalog.roles), true);
|
||||
});
|
||||
|
||||
test('POST /core/rapid-orders/parse enforces per-user model rate limit', async () => {
|
||||
process.env.LLM_RATE_LIMIT_PER_MINUTE = '1';
|
||||
const app = createApp();
|
||||
|
||||
Reference in New Issue
Block a user