make some overall QoL improvements
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user