test: rearrange relationships test blocks properly (#11858)
Previously, many test cases in `int/relationships` were wrapped to the "custom IDs" describe block even though they aren't related to custom IDs at all. This rearranges them as they should be.
This commit is contained in:
@@ -397,21 +397,7 @@ describe('Relationships', () => {
|
|||||||
expect(result.docs[0].id).toBe(id)
|
expect(result.docs[0].id).toBe(id)
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('Custom ID', () => {
|
describe('hasMany relationships', () => {
|
||||||
it('should query a custom id relation', async () => {
|
|
||||||
const { customIdRelation } = await restClient
|
|
||||||
.GET(`/${slug}/${post.id}`)
|
|
||||||
.then((res) => res.json())
|
|
||||||
expect(customIdRelation).toMatchObject({ id: generatedCustomId })
|
|
||||||
})
|
|
||||||
|
|
||||||
it('should query a custom id number relation', async () => {
|
|
||||||
const { customIdNumberRelation } = await restClient
|
|
||||||
.GET(`/${slug}/${post.id}`)
|
|
||||||
.then((res) => res.json())
|
|
||||||
expect(customIdNumberRelation).toMatchObject({ id: generatedCustomIdNumber })
|
|
||||||
})
|
|
||||||
|
|
||||||
it('should retrieve totalDocs correctly with hasMany,', async () => {
|
it('should retrieve totalDocs correctly with hasMany,', async () => {
|
||||||
const movie1 = await payload.create({
|
const movie1 = await payload.create({
|
||||||
collection: 'movies',
|
collection: 'movies',
|
||||||
@@ -592,47 +578,59 @@ describe('Relationships', () => {
|
|||||||
expect(query1.totalDocs).toStrictEqual(1)
|
expect(query1.totalDocs).toStrictEqual(1)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should sort by a property of a hasMany relationship', async () => {
|
it('should query using "in" by hasMany relationship field', async () => {
|
||||||
const movie1 = await payload.create({
|
const tree1 = await payload.create({
|
||||||
collection: 'movies',
|
collection: treeSlug,
|
||||||
data: {
|
data: {
|
||||||
name: 'Pulp Fiction',
|
text: 'Tree 1',
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
const movie2 = await payload.create({
|
const tree2 = await payload.create({
|
||||||
collection: 'movies',
|
collection: treeSlug,
|
||||||
data: {
|
data: {
|
||||||
name: 'Inception',
|
parent: tree1.id,
|
||||||
|
text: 'Tree 2',
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
await payload.delete({ collection: 'directors', where: {} })
|
const tree3 = await payload.create({
|
||||||
|
collection: treeSlug,
|
||||||
const director1 = await payload.create({
|
|
||||||
collection: 'directors',
|
|
||||||
data: {
|
data: {
|
||||||
name: 'Quentin Tarantino',
|
parent: tree2.id,
|
||||||
movies: [movie1.id],
|
text: 'Tree 3',
|
||||||
},
|
|
||||||
})
|
|
||||||
const director2 = await payload.create({
|
|
||||||
collection: 'directors',
|
|
||||||
data: {
|
|
||||||
name: 'Christopher Nolan',
|
|
||||||
movies: [movie2.id],
|
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
const result = await payload.find({
|
const tree4 = await payload.create({
|
||||||
collection: 'directors',
|
collection: treeSlug,
|
||||||
|
data: {
|
||||||
|
parent: tree3.id,
|
||||||
|
text: 'Tree 4',
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
const validParents = [tree2.id, tree3.id]
|
||||||
|
|
||||||
|
const query = await payload.find({
|
||||||
|
collection: treeSlug,
|
||||||
depth: 0,
|
depth: 0,
|
||||||
sort: '-movies.name',
|
sort: 'createdAt',
|
||||||
|
where: {
|
||||||
|
parent: {
|
||||||
|
in: validParents,
|
||||||
|
},
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
// should only return tree3 and tree4
|
||||||
|
|
||||||
expect(result.docs[0].id).toStrictEqual(director1.id)
|
expect(query.totalDocs).toEqual(2)
|
||||||
|
expect(query.docs[0].text).toEqual('Tree 3')
|
||||||
|
expect(query.docs[1].text).toEqual('Tree 4')
|
||||||
})
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
describe('sorting by relationships', () => {
|
||||||
it('should sort by a property of a relationship', async () => {
|
it('should sort by a property of a relationship', async () => {
|
||||||
await payload.delete({ collection: 'directors', where: {} })
|
await payload.delete({ collection: 'directors', where: {} })
|
||||||
await payload.delete({ collection: 'movies', where: {} })
|
await payload.delete({ collection: 'movies', where: {} })
|
||||||
@@ -719,236 +717,61 @@ describe('Relationships', () => {
|
|||||||
expect(localized_res_2.docs).toStrictEqual([movie_1, movie_2])
|
expect(localized_res_2.docs).toStrictEqual([movie_1, movie_2])
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should query using "in" by hasMany relationship field', async () => {
|
it('should sort by a property of a hasMany relationship', async () => {
|
||||||
const tree1 = await payload.create({
|
const movie1 = await payload.create({
|
||||||
collection: treeSlug,
|
collection: 'movies',
|
||||||
data: {
|
data: {
|
||||||
text: 'Tree 1',
|
name: 'Pulp Fiction',
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
const tree2 = await payload.create({
|
const movie2 = await payload.create({
|
||||||
collection: treeSlug,
|
collection: 'movies',
|
||||||
data: {
|
data: {
|
||||||
parent: tree1.id,
|
name: 'Inception',
|
||||||
text: 'Tree 2',
|
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
const tree3 = await payload.create({
|
await payload.delete({ collection: 'directors', where: {} })
|
||||||
collection: treeSlug,
|
|
||||||
|
const director1 = await payload.create({
|
||||||
|
collection: 'directors',
|
||||||
data: {
|
data: {
|
||||||
parent: tree2.id,
|
name: 'Quentin Tarantino',
|
||||||
text: 'Tree 3',
|
movies: [movie1.id],
|
||||||
|
},
|
||||||
|
})
|
||||||
|
const director2 = await payload.create({
|
||||||
|
collection: 'directors',
|
||||||
|
data: {
|
||||||
|
name: 'Christopher Nolan',
|
||||||
|
movies: [movie2.id],
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
const tree4 = await payload.create({
|
const result = await payload.find({
|
||||||
collection: treeSlug,
|
collection: 'directors',
|
||||||
data: {
|
|
||||||
parent: tree3.id,
|
|
||||||
text: 'Tree 4',
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
const validParents = [tree2.id, tree3.id]
|
|
||||||
|
|
||||||
const query = await payload.find({
|
|
||||||
collection: treeSlug,
|
|
||||||
depth: 0,
|
depth: 0,
|
||||||
sort: 'createdAt',
|
sort: '-movies.name',
|
||||||
where: {
|
|
||||||
parent: {
|
|
||||||
in: validParents,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
// should only return tree3 and tree4
|
|
||||||
|
|
||||||
expect(query.totalDocs).toEqual(2)
|
expect(result.docs[0].id).toStrictEqual(director1.id)
|
||||||
expect(query.docs[0].text).toEqual('Tree 3')
|
})
|
||||||
expect(query.docs[1].text).toEqual('Tree 4')
|
})
|
||||||
|
|
||||||
|
describe('Custom ID', () => {
|
||||||
|
it('should query a custom id relation', async () => {
|
||||||
|
const { customIdRelation } = await restClient
|
||||||
|
.GET(`/${slug}/${post.id}`)
|
||||||
|
.then((res) => res.json())
|
||||||
|
expect(customIdRelation).toMatchObject({ id: generatedCustomId })
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should validate the format of text id relationships', async () => {
|
it('should query a custom id number relation', async () => {
|
||||||
await expect(async () =>
|
const { customIdNumberRelation } = await restClient
|
||||||
createPost({
|
.GET(`/${slug}/${post.id}`)
|
||||||
// @ts-expect-error Sending bad data to test error handling
|
.then((res) => res.json())
|
||||||
customIdRelation: 1234,
|
expect(customIdNumberRelation).toMatchObject({ id: generatedCustomIdNumber })
|
||||||
}),
|
|
||||||
).rejects.toThrow('The following field is invalid: Custom Id Relation')
|
|
||||||
})
|
|
||||||
|
|
||||||
it('should validate the format of number id relationships', async () => {
|
|
||||||
await expect(async () =>
|
|
||||||
createPost({
|
|
||||||
// @ts-expect-error Sending bad data to test error handling
|
|
||||||
customIdNumberRelation: 'bad-input',
|
|
||||||
}),
|
|
||||||
).rejects.toThrow('The following field is invalid: Custom Id Number Relation')
|
|
||||||
})
|
|
||||||
|
|
||||||
it('should allow update removing a relationship', async () => {
|
|
||||||
const response = await restClient.PATCH(`/${slug}/${post.id}`, {
|
|
||||||
body: JSON.stringify({
|
|
||||||
customIdRelation: null,
|
|
||||||
relationField: null,
|
|
||||||
}),
|
|
||||||
})
|
|
||||||
const doc = await response.json()
|
|
||||||
|
|
||||||
expect(response.status).toEqual(200)
|
|
||||||
expect(doc.relationField).toBeFalsy()
|
|
||||||
})
|
|
||||||
|
|
||||||
it('should query a polymorphic relationship field with mixed custom ids and default', async () => {
|
|
||||||
const customIDNumber = await payload.create({
|
|
||||||
collection: 'custom-id-number',
|
|
||||||
data: { id: 999 },
|
|
||||||
})
|
|
||||||
|
|
||||||
const customIDText = await payload.create({
|
|
||||||
collection: 'custom-id',
|
|
||||||
data: { id: 'custom-id' },
|
|
||||||
})
|
|
||||||
|
|
||||||
const page = await payload.create({
|
|
||||||
collection: 'pages',
|
|
||||||
data: {},
|
|
||||||
})
|
|
||||||
|
|
||||||
const relToCustomIdText = await payload.create({
|
|
||||||
collection: 'rels-to-pages-and-custom-text-ids',
|
|
||||||
data: {
|
|
||||||
rel: {
|
|
||||||
relationTo: 'custom-id',
|
|
||||||
value: customIDText.id,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
const relToCustomIdNumber = await payload.create({
|
|
||||||
collection: 'rels-to-pages-and-custom-text-ids',
|
|
||||||
data: {
|
|
||||||
rel: {
|
|
||||||
relationTo: 'custom-id-number',
|
|
||||||
value: customIDNumber.id,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
const relToPage = await payload.create({
|
|
||||||
collection: 'rels-to-pages-and-custom-text-ids',
|
|
||||||
data: {
|
|
||||||
rel: {
|
|
||||||
relationTo: 'pages',
|
|
||||||
value: page.id,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
const pageResult = await payload.find({
|
|
||||||
collection: 'rels-to-pages-and-custom-text-ids',
|
|
||||||
where: {
|
|
||||||
and: [
|
|
||||||
{
|
|
||||||
'rel.value': {
|
|
||||||
equals: page.id,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'rel.relationTo': {
|
|
||||||
equals: 'pages',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
expect(pageResult.totalDocs).toBe(1)
|
|
||||||
expect(pageResult.docs[0].id).toBe(relToPage.id)
|
|
||||||
|
|
||||||
const customIDResult = await payload.find({
|
|
||||||
collection: 'rels-to-pages-and-custom-text-ids',
|
|
||||||
where: {
|
|
||||||
and: [
|
|
||||||
{
|
|
||||||
'rel.value': {
|
|
||||||
equals: customIDText.id,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'rel.relationTo': {
|
|
||||||
equals: 'custom-id',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
expect(customIDResult.totalDocs).toBe(1)
|
|
||||||
expect(customIDResult.docs[0].id).toBe(relToCustomIdText.id)
|
|
||||||
|
|
||||||
const customIDNumberResult = await payload.find({
|
|
||||||
collection: 'rels-to-pages-and-custom-text-ids',
|
|
||||||
where: {
|
|
||||||
and: [
|
|
||||||
{
|
|
||||||
'rel.value': {
|
|
||||||
equals: customIDNumber.id,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'rel.relationTo': {
|
|
||||||
equals: 'custom-id-number',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
expect(customIDNumberResult.totalDocs).toBe(1)
|
|
||||||
expect(customIDNumberResult.docs[0].id).toBe(relToCustomIdNumber.id)
|
|
||||||
|
|
||||||
const inResult_1 = await payload.find({
|
|
||||||
collection: 'rels-to-pages-and-custom-text-ids',
|
|
||||||
where: {
|
|
||||||
'rel.value': {
|
|
||||||
in: [page.id, customIDNumber.id],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
expect(inResult_1.totalDocs).toBe(2)
|
|
||||||
expect(inResult_1.docs.some((each) => each.id === relToPage.id)).toBeTruthy()
|
|
||||||
expect(inResult_1.docs.some((each) => each.id === relToCustomIdNumber.id)).toBeTruthy()
|
|
||||||
|
|
||||||
const inResult_2 = await payload.find({
|
|
||||||
collection: 'rels-to-pages-and-custom-text-ids',
|
|
||||||
where: {
|
|
||||||
'rel.value': {
|
|
||||||
in: [customIDNumber.id, customIDText.id],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
expect(inResult_2.totalDocs).toBe(2)
|
|
||||||
expect(inResult_2.docs.some((each) => each.id === relToCustomIdText.id)).toBeTruthy()
|
|
||||||
expect(inResult_2.docs.some((each) => each.id === relToCustomIdNumber.id)).toBeTruthy()
|
|
||||||
|
|
||||||
const inResult_3 = await payload.find({
|
|
||||||
collection: 'rels-to-pages-and-custom-text-ids',
|
|
||||||
where: {
|
|
||||||
'rel.value': {
|
|
||||||
in: [customIDNumber.id, customIDText.id, page.id],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
expect(inResult_3.totalDocs).toBe(3)
|
|
||||||
expect(inResult_3.docs.some((each) => each.id === relToCustomIdText.id)).toBeTruthy()
|
|
||||||
expect(inResult_3.docs.some((each) => each.id === relToCustomIdNumber.id)).toBeTruthy()
|
|
||||||
expect(inResult_3.docs.some((each) => each.id === relToPage.id)).toBeTruthy()
|
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -1072,6 +895,19 @@ describe('Relationships', () => {
|
|||||||
expect(docs.map((doc) => doc?.id)).not.toContain(localizedPost2.id)
|
expect(docs.map((doc) => doc?.id)).not.toContain(localizedPost2.id)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('should allow update removing a relationship', async () => {
|
||||||
|
const response = await restClient.PATCH(`/${slug}/${post.id}`, {
|
||||||
|
body: JSON.stringify({
|
||||||
|
customIdRelation: null,
|
||||||
|
relationField: null,
|
||||||
|
}),
|
||||||
|
})
|
||||||
|
const doc = await response.json()
|
||||||
|
|
||||||
|
expect(response.status).toEqual(200)
|
||||||
|
expect(doc.relationField).toBeFalsy()
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('Nested Querying', () => {
|
describe('Nested Querying', () => {
|
||||||
@@ -1797,6 +1633,174 @@ describe('Relationships', () => {
|
|||||||
|
|
||||||
expect(updated.status).toBe('completed')
|
expect(updated.status).toBe('completed')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('should validate the format of text id relationships', async () => {
|
||||||
|
await expect(async () =>
|
||||||
|
createPost({
|
||||||
|
// @ts-expect-error Sending bad data to test error handling
|
||||||
|
customIdRelation: 1234,
|
||||||
|
}),
|
||||||
|
).rejects.toThrow('The following field is invalid: Custom Id Relation')
|
||||||
|
})
|
||||||
|
|
||||||
|
it('should validate the format of number id relationships', async () => {
|
||||||
|
await expect(async () =>
|
||||||
|
createPost({
|
||||||
|
// @ts-expect-error Sending bad data to test error handling
|
||||||
|
customIdNumberRelation: 'bad-input',
|
||||||
|
}),
|
||||||
|
).rejects.toThrow('The following field is invalid: Custom Id Number Relation')
|
||||||
|
})
|
||||||
|
|
||||||
|
it('should query a polymorphic relationship field with mixed custom ids and default', async () => {
|
||||||
|
const customIDNumber = await payload.create({
|
||||||
|
collection: 'custom-id-number',
|
||||||
|
data: { id: 999 },
|
||||||
|
})
|
||||||
|
|
||||||
|
const customIDText = await payload.create({
|
||||||
|
collection: 'custom-id',
|
||||||
|
data: { id: 'custom-id' },
|
||||||
|
})
|
||||||
|
|
||||||
|
const page = await payload.create({
|
||||||
|
collection: 'pages',
|
||||||
|
data: {},
|
||||||
|
})
|
||||||
|
|
||||||
|
const relToCustomIdText = await payload.create({
|
||||||
|
collection: 'rels-to-pages-and-custom-text-ids',
|
||||||
|
data: {
|
||||||
|
rel: {
|
||||||
|
relationTo: 'custom-id',
|
||||||
|
value: customIDText.id,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
const relToCustomIdNumber = await payload.create({
|
||||||
|
collection: 'rels-to-pages-and-custom-text-ids',
|
||||||
|
data: {
|
||||||
|
rel: {
|
||||||
|
relationTo: 'custom-id-number',
|
||||||
|
value: customIDNumber.id,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
const relToPage = await payload.create({
|
||||||
|
collection: 'rels-to-pages-and-custom-text-ids',
|
||||||
|
data: {
|
||||||
|
rel: {
|
||||||
|
relationTo: 'pages',
|
||||||
|
value: page.id,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
const pageResult = await payload.find({
|
||||||
|
collection: 'rels-to-pages-and-custom-text-ids',
|
||||||
|
where: {
|
||||||
|
and: [
|
||||||
|
{
|
||||||
|
'rel.value': {
|
||||||
|
equals: page.id,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'rel.relationTo': {
|
||||||
|
equals: 'pages',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
expect(pageResult.totalDocs).toBe(1)
|
||||||
|
expect(pageResult.docs[0].id).toBe(relToPage.id)
|
||||||
|
|
||||||
|
const customIDResult = await payload.find({
|
||||||
|
collection: 'rels-to-pages-and-custom-text-ids',
|
||||||
|
where: {
|
||||||
|
and: [
|
||||||
|
{
|
||||||
|
'rel.value': {
|
||||||
|
equals: customIDText.id,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'rel.relationTo': {
|
||||||
|
equals: 'custom-id',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
expect(customIDResult.totalDocs).toBe(1)
|
||||||
|
expect(customIDResult.docs[0].id).toBe(relToCustomIdText.id)
|
||||||
|
|
||||||
|
const customIDNumberResult = await payload.find({
|
||||||
|
collection: 'rels-to-pages-and-custom-text-ids',
|
||||||
|
where: {
|
||||||
|
and: [
|
||||||
|
{
|
||||||
|
'rel.value': {
|
||||||
|
equals: customIDNumber.id,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'rel.relationTo': {
|
||||||
|
equals: 'custom-id-number',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
expect(customIDNumberResult.totalDocs).toBe(1)
|
||||||
|
expect(customIDNumberResult.docs[0].id).toBe(relToCustomIdNumber.id)
|
||||||
|
|
||||||
|
const inResult_1 = await payload.find({
|
||||||
|
collection: 'rels-to-pages-and-custom-text-ids',
|
||||||
|
where: {
|
||||||
|
'rel.value': {
|
||||||
|
in: [page.id, customIDNumber.id],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
expect(inResult_1.totalDocs).toBe(2)
|
||||||
|
expect(inResult_1.docs.some((each) => each.id === relToPage.id)).toBeTruthy()
|
||||||
|
expect(inResult_1.docs.some((each) => each.id === relToCustomIdNumber.id)).toBeTruthy()
|
||||||
|
|
||||||
|
const inResult_2 = await payload.find({
|
||||||
|
collection: 'rels-to-pages-and-custom-text-ids',
|
||||||
|
where: {
|
||||||
|
'rel.value': {
|
||||||
|
in: [customIDNumber.id, customIDText.id],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
expect(inResult_2.totalDocs).toBe(2)
|
||||||
|
expect(inResult_2.docs.some((each) => each.id === relToCustomIdText.id)).toBeTruthy()
|
||||||
|
expect(inResult_2.docs.some((each) => each.id === relToCustomIdNumber.id)).toBeTruthy()
|
||||||
|
|
||||||
|
const inResult_3 = await payload.find({
|
||||||
|
collection: 'rels-to-pages-and-custom-text-ids',
|
||||||
|
where: {
|
||||||
|
'rel.value': {
|
||||||
|
in: [customIDNumber.id, customIDText.id, page.id],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
expect(inResult_3.totalDocs).toBe(3)
|
||||||
|
expect(inResult_3.docs.some((each) => each.id === relToCustomIdText.id)).toBeTruthy()
|
||||||
|
expect(inResult_3.docs.some((each) => each.id === relToCustomIdNumber.id)).toBeTruthy()
|
||||||
|
expect(inResult_3.docs.some((each) => each.id === relToPage.id)).toBeTruthy()
|
||||||
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user