chore: shortens collection names in relationship test suite
This commit is contained in:
@@ -39,9 +39,9 @@ const collectionWithName = (collectionSlug: string): CollectionConfig => {
|
||||
export const slug = 'posts'
|
||||
export const relationSlug = 'relation'
|
||||
export const defaultAccessRelSlug = 'strict-access'
|
||||
export const chainedRelSlug = 'chained-relation'
|
||||
export const customIdSlug = 'custom-id-relation'
|
||||
export const customIdNumberSlug = 'custom-id-number-relation'
|
||||
export const chainedRelSlug = 'chained'
|
||||
export const customIdSlug = 'custom-id'
|
||||
export const customIdNumberSlug = 'custom-id-number'
|
||||
export default buildConfigWithDefaults({
|
||||
collections: [
|
||||
{
|
||||
|
||||
@@ -261,7 +261,7 @@ describe('Relationships', () => {
|
||||
|
||||
beforeAll(async () => {
|
||||
const thirdLevelDoc = await payload.create({
|
||||
collection: 'chained-relation',
|
||||
collection: 'chained',
|
||||
data: {
|
||||
name: 'third',
|
||||
},
|
||||
@@ -270,7 +270,7 @@ describe('Relationships', () => {
|
||||
thirdLevelID = thirdLevelDoc.id
|
||||
|
||||
const secondLevelDoc = await payload.create({
|
||||
collection: 'chained-relation',
|
||||
collection: 'chained',
|
||||
data: {
|
||||
name: 'second',
|
||||
relation: thirdLevelID,
|
||||
@@ -280,7 +280,7 @@ describe('Relationships', () => {
|
||||
secondLevelID = secondLevelDoc.id
|
||||
|
||||
const firstLevelDoc = await payload.create({
|
||||
collection: 'chained-relation',
|
||||
collection: 'chained',
|
||||
data: {
|
||||
name: 'first',
|
||||
relation: secondLevelID,
|
||||
@@ -292,7 +292,7 @@ describe('Relationships', () => {
|
||||
|
||||
it('should allow querying one level deep', async () => {
|
||||
const query1 = await payload.find({
|
||||
collection: 'chained-relation',
|
||||
collection: 'chained',
|
||||
where: {
|
||||
'relation.name': {
|
||||
equals: 'second',
|
||||
@@ -304,7 +304,7 @@ describe('Relationships', () => {
|
||||
expect(query1.docs[0].id).toStrictEqual(firstLevelID)
|
||||
|
||||
const query2 = await payload.find({
|
||||
collection: 'chained-relation',
|
||||
collection: 'chained',
|
||||
where: {
|
||||
'relation.name': {
|
||||
equals: 'third',
|
||||
@@ -318,7 +318,7 @@ describe('Relationships', () => {
|
||||
|
||||
it('should allow querying two levels deep', async () => {
|
||||
const query = await payload.find({
|
||||
collection: 'chained-relation',
|
||||
collection: 'chained',
|
||||
where: {
|
||||
'relation.relation.name': {
|
||||
equals: 'third',
|
||||
|
||||
Reference in New Issue
Block a user