test: add initial Cypress e2e test infrastructure

Smoke tests for verifying Cypress runs, plus basic API tests
for health and sessions endpoints.
This commit is contained in:
2026-02-15 23:05:56 +01:00
parent 3feedd5698
commit 991080ae2b
6 changed files with 2333 additions and 0 deletions

58
cypress/e2e/smoke.cy.js Normal file
View File

@@ -0,0 +1,58 @@
/// <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
);
});
});