chore: fix community test (#9186)
This commit is contained in:
@@ -52,19 +52,19 @@ describe('_Community Tests', () => {
|
|||||||
const newPost = await payload.create({
|
const newPost = await payload.create({
|
||||||
collection: postsSlug,
|
collection: postsSlug,
|
||||||
data: {
|
data: {
|
||||||
text: 'LOCAL API EXAMPLE',
|
title: 'LOCAL API EXAMPLE',
|
||||||
},
|
},
|
||||||
context: {},
|
context: {},
|
||||||
})
|
})
|
||||||
|
|
||||||
expect(newPost.text).toEqual('LOCAL API EXAMPLE')
|
expect(newPost.title).toEqual('LOCAL API EXAMPLE')
|
||||||
})
|
})
|
||||||
|
|
||||||
it('rest API example', async () => {
|
it('rest API example', async () => {
|
||||||
const data = await restClient
|
const data = await restClient
|
||||||
.POST(`/${postsSlug}`, {
|
.POST(`/${postsSlug}`, {
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
text: 'REST API EXAMPLE',
|
title: 'REST API EXAMPLE',
|
||||||
}),
|
}),
|
||||||
headers: {
|
headers: {
|
||||||
Authorization: `JWT ${token}`,
|
Authorization: `JWT ${token}`,
|
||||||
@@ -72,6 +72,6 @@ describe('_Community Tests', () => {
|
|||||||
})
|
})
|
||||||
.then((res) => res.json())
|
.then((res) => res.json())
|
||||||
|
|
||||||
expect(data.doc.text).toEqual('REST API EXAMPLE')
|
expect(data.doc.title).toEqual('REST API EXAMPLE')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user