Five package-level test runners validating extension API contracts: - notes-runner: CRUD, folders, tags, search, backlinks (12 tests) - chat-runner: conversations, messaging, search (9 tests) - schedules-runner: CRUD + run (5 tests) - workflow-runner: definitions, instances, stage progression (5 tests) - renderer-runner: registry contract, block matching (4 tests) Runner Result API (in-memory, 3 admin endpoints) stores results from browser runs for CI consumption. Test-runners surface v0.2.0 posts results after each run and fixes suite prefix matching. CI integration via Playwright: wait-for-healthy.sh, run-surface-tests.sh, surface-test-driver.js. New test-runners stage in Gitea CI pipeline. Verified: 169 passed, 0 failed, 9 warned, 8 skipped on fresh install. Go handler tests: 4/4 passing. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
60 lines
1.8 KiB
JavaScript
60 lines
1.8 KiB
JavaScript
/**
|
|
* Chat Runner — chat/conversations suite
|
|
*
|
|
* Tests conversation CRUD via the chat-core ext API.
|
|
*/
|
|
(function () {
|
|
'use strict';
|
|
|
|
var api = window.CR.api;
|
|
|
|
sw.testing.suite('chat/conversations', async function (s) {
|
|
var convId;
|
|
|
|
s.test('create conversation', async function (t) {
|
|
var r = await api.post('/conversations', {
|
|
title: 'Runner Test Convo ' + Date.now(),
|
|
type: 'direct'
|
|
});
|
|
t.assert.ok(r.id, 'conversation has id');
|
|
t.assert.ok(r.title, 'conversation has title');
|
|
convId = r.id;
|
|
s.track('conversation', convId);
|
|
});
|
|
|
|
s.test('get conversation', async function (t) {
|
|
t.assert.ok(convId, 'convId from previous test');
|
|
var r = await api.get('/conversations/' + convId);
|
|
t.assert.eq(r.id, convId, 'id matches');
|
|
});
|
|
|
|
s.test('update conversation', async function (t) {
|
|
t.assert.ok(convId, 'convId from previous test');
|
|
var r = await api.put('/conversations/' + convId, {
|
|
title: 'Updated Convo Title'
|
|
});
|
|
t.assert.eq(r.title, 'Updated Convo Title', 'title updated');
|
|
});
|
|
|
|
s.test('list conversations', async function (t) {
|
|
var r = await api.get('/conversations');
|
|
var list = Array.isArray(r) ? r : (r.data || []);
|
|
t.assert.ok(Array.isArray(list), 'response is array');
|
|
var found = list.some(function (c) { return c.id === convId; });
|
|
t.assert.ok(found, 'created conversation in list');
|
|
});
|
|
|
|
s.test('delete conversation', async function (t) {
|
|
t.assert.ok(convId, 'convId from previous test');
|
|
await api.del('/conversations/' + convId);
|
|
try {
|
|
await api.get('/conversations/' + convId);
|
|
t.assert.ok(false, 'expected error after delete');
|
|
} catch (e) {
|
|
t.assert.ok(true, 'conversation not found after delete');
|
|
}
|
|
convId = null;
|
|
});
|
|
});
|
|
})();
|