Merge pull request #18374 from overleaf/em-chat-resolved-thread-ids

Add resolved-thread-ids endpoint to chat

GitOrigin-RevId: 211dee88707f2d7fb1c0c8805a1f6ac28dca494d
This commit is contained in:
Eric Mc Sween
2024-05-27 10:22:15 +00:00
committed by Copybot
parent 5af6acde2b
commit 814b085b44
5 changed files with 70 additions and 3 deletions
@@ -38,6 +38,13 @@ describe('Resolving a thread', async function () {
const resolvedAt = new Date(threads[threadId].resolved_at)
expect(new Date() - resolvedAt).to.be.below(1000)
})
it('should list the thread id in the resolved thread ids endpoint', async function () {
const { response, body } =
await ChatClient.getResolvedThreadIds(projectId)
expect(response.statusCode).to.equal(200)
expect(body.resolvedThreadIds).to.include(threadId)
})
})
describe('when a thread is not resolved', async function () {
@@ -58,6 +65,13 @@ describe('Resolving a thread', async function () {
expect(response.statusCode).to.equal(200)
expect(threads[threadId].resolved).to.be.undefined
})
it('should not list the thread in the resolved thread ids endpoint', async function () {
const { response, body } =
await ChatClient.getResolvedThreadIds(projectId)
expect(response.statusCode).to.equal(200)
expect(body.resolvedThreadIds).not.to.include(threadId)
})
})
describe('when a thread is resolved then reopened', async function () {
@@ -89,5 +103,12 @@ describe('Resolving a thread', async function () {
expect(response.statusCode).to.equal(200)
expect(threads[threadId].resolved).to.be.undefined
})
it('should not list the thread in the resolved thread ids endpoint', async function () {
const { response, body } =
await ChatClient.getResolvedThreadIds(projectId)
expect(response.statusCode).to.equal(200)
expect(body.resolvedThreadIds).not.to.include(threadId)
})
})
})