tests: fixes outdated test

This commit is contained in:
James
2022-02-07 16:44:56 -05:00
parent 03c8445a6d
commit 86890a2de4
3 changed files with 5 additions and 1 deletions

View File

@@ -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

View File

@@ -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 = {

View File

@@ -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);