chore: fix relationships test

This commit is contained in:
Jarrod Flesch
2024-03-08 16:11:12 -05:00
parent d3856693ce
commit 0e91cddab9

View File

@@ -11,7 +11,6 @@ import type {
} from './payload-types.js' } from './payload-types.js'
import { getPayload } from '../../packages/payload/src/index.js' import { getPayload } from '../../packages/payload/src/index.js'
import { devUser } from '../credentials.js'
import { NextRESTClient } from '../helpers/NextRESTClient.js' import { NextRESTClient } from '../helpers/NextRESTClient.js'
import { startMemoryDB } from '../startMemoryDB.js' import { startMemoryDB } from '../startMemoryDB.js'
import configPromise from './config.js' import configPromise from './config.js'
@@ -27,16 +26,9 @@ import {
usersSlug, usersSlug,
} from './shared.js' } from './shared.js'
let apiUrl
let jwt
let restClient: NextRESTClient let restClient: NextRESTClient
let payload: Payload let payload: Payload
const headers = {
'Content-Type': 'application/json',
}
const { email, password } = devUser
type EasierChained = { id: string; relation: EasierChained } type EasierChained = { id: string; relation: EasierChained }
describe('Relationships', () => { describe('Relationships', () => {
@@ -757,14 +749,11 @@ describe('Relationships', () => {
], ],
}, },
}, },
headers: {
Authorization: `JWT ${token}`,
},
}) })
.then((res) => res.json()) .then((res) => res.json())
expect(queryOne.result.docs).toHaveLength(1) expect(queryOne.docs).toHaveLength(1)
expect(queryTwo.result.docs).toHaveLength(1) expect(queryTwo.docs).toHaveLength(1)
}) })
}) })
}) })