tests: fixes outdated test
This commit is contained in:
@@ -19,3 +19,4 @@ Drafts are available in Payload v. `0.14.0-beta.0` and newer.
|
||||
- Options
|
||||
- need header for `#api`
|
||||
- access control example to describe how to limit people from viewing drafts
|
||||
- talk about ?draft=true, how you can deliberately ask for newer drafts for docs and they will be sent back accordingly automatically
|
||||
|
||||
@@ -102,6 +102,7 @@ async function find<T extends TypeWithID = any>(incomingArgs: Arguments): Promis
|
||||
// /////////////////////////////////////
|
||||
// Find
|
||||
// /////////////////////////////////////
|
||||
|
||||
const [sortProperty, sortOrder] = buildSortParam(args.sort, collectionConfig.timestamps);
|
||||
|
||||
const optionsToExecute = {
|
||||
|
||||
@@ -161,7 +161,9 @@ describe('Versions - REST', () => {
|
||||
|
||||
it('should prevent an authenticated user from retrieving drafts without asking', async () => {
|
||||
const badAttempt = await fetch(`${url}/api/autosave-posts/${postID}`, {
|
||||
headers,
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
});
|
||||
|
||||
expect(badAttempt.status).toBe(404);
|
||||
|
||||
Reference in New Issue
Block a user