fix: missing find collection versions REST endpoint (#10573)

The `/api/:collection/versions` endpoint was missing, added a test to
prevent regressions like this.
This commit is contained in:
Sasha
2025-01-14 20:35:32 +02:00
committed by GitHub
parent 16ad7a671f
commit 120735c55c
2 changed files with 20 additions and 0 deletions

View File

@@ -1436,6 +1436,20 @@ describe('Versions', () => {
})
})
describe('Collections - REST', () => {
it('sholud query versions', async () => {
const response = await restClient.GET(`/${collection}/versions`)
expect(response.status).toBe(200)
const json = await response.json()
expect(json.docs[0].parent).toBe(collectionLocalPostID)
const responseByID = await restClient.GET(`/${collection}/versions/${json.docs[0].id}`)
expect(responseByID.status).toBe(200)
const jsonByID = await responseByID.json()
expect(jsonByID.parent).toBe(collectionLocalPostID)
})
})
describe('Globals - Local', () => {
beforeEach(async () => {
const title2 = 'Here is an updated global title in EN'