make some overall QoL improvements

This commit is contained in:
Frederik Spirgi
2026-09-30 11:05:13 +02:00
parent d15f7867d5
commit c69070a6e6
18 changed files with 256 additions and 78 deletions
+24
View File
@@ -887,6 +887,30 @@ test("chat search, organization, and workspace export work", async () => {
await server.close();
});
test("archiving frees an active chat slot and restoring respects the limit", async () => {
const server = await startTestServer({config: {chatLimit: 1}});
try {
const jar = new CookieJar();
await request(server.baseUrl, "/register", {method: "POST", body: {username: "archiver", password: "password123"}});
await request(server.baseUrl, "/login", {method: "POST", body: {username: "archiver", password: "password123"}, jar});
const first = await request(server.baseUrl, "/chats", {method: "POST", body: {title: "First"}, jar});
assert.equal(first.status, 200);
assert.equal((await request(server.baseUrl, "/chats", {method: "POST", body: {title: "Blocked"}, jar})).status, 400);
assert.equal((await request(server.baseUrl, `/chats/${first.json.chat.id}/organization`, {
method: "PUT", body: {archived: true}, jar
})).status, 200);
const second = await request(server.baseUrl, "/chats", {method: "POST", body: {title: "Second"}, jar});
assert.equal(second.status, 200);
assert.equal((await request(server.baseUrl, `/chats/${first.json.chat.id}/organization`, {
method: "PUT", body: {archived: false}, jar
})).status, 400);
await request(server.baseUrl, `/chats/${second.json.chat.id}/organization`, {method: "PUT", body: {archived: true}, jar});
assert.equal((await request(server.baseUrl, `/chats/${first.json.chat.id}/organization`, {
method: "PUT", body: {archived: false}, jar
})).status, 200);
} finally { await server.close(); }
});
test("persona clone, version restore, and market feedback endpoints work", async () => {
const server = await startTestServer();
const jar = new CookieJar();