test: strengthen Cypress e2e tests with real API assertions

- Remove blanket uncaught:exception suppressor (API-only tests)
- Trim smoke test to single infra-verification assertion
- Rewrite health test with strict status/field assertions, no failOnStatusCode
- Add session CRUD tests (create, get, list, delete, 404 cases, cleanup)
- Use Cypress.env('API_URL') instead of baseUrl to avoid blocking smoke tests
- Remove unused main and type fields from package.json
This commit is contained in:
2026-02-15 23:57:48 +01:00
parent 991080ae2b
commit 217d41d680
5 changed files with 116 additions and 80 deletions

View File

@@ -1,58 +1,7 @@
/// <reference types="cypress" />
/**
* Smoke test to verify that the Cypress test infrastructure is
* correctly installed and configured. These tests do NOT require
* the lovdata-chat stack to be running.
*/
describe('Cypress Infrastructure Smoke Test', () => {
it('should execute a basic assertion', () => {
expect(true).to.be.true;
});
it('should handle arrays and objects', () => {
const session = {
id: 'test-session-001',
status: 'running',
model: 'opencode/kimi-k2.5-free',
};
expect(session).to.have.property('id');
expect(session.status).to.eq('running');
expect(session.model).to.include('kimi');
});
it('should validate the allowed models whitelist structure', () => {
const allowedModels = [
{
id: 'opencode/kimi-k2.5-free',
display_name: 'Kimi K2.5',
provider: 'zen',
is_reasoning: false,
is_default: true,
},
{
id: 'anthropic/claude-sonnet-4-thinking',
display_name: 'Claude Sonnet 4 (Thinking)',
provider: 'zen',
is_reasoning: true,
thinking_budget_default: 10000,
thinking_budget_max: 50000,
},
];
expect(allowedModels).to.have.length(2);
const defaultModel = allowedModels.find((m) => m.is_default);
expect(defaultModel).to.exist;
expect(defaultModel.id).to.eq('opencode/kimi-k2.5-free');
const reasoningModels = allowedModels.filter((m) => m.is_reasoning);
expect(reasoningModels).to.have.length(1);
expect(reasoningModels[0]).to.have.property('thinking_budget_default');
expect(reasoningModels[0]).to.have.property('thinking_budget_max');
expect(reasoningModels[0].thinking_budget_max).to.be.greaterThan(
reasoningModels[0].thinking_budget_default
);
});
});