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:
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user