From cc8b6362480853e220b5841bd9b861a040000a51 Mon Sep 17 00:00:00 2001 From: Dan Ribbens Date: Mon, 18 Jul 2022 12:19:35 -0400 Subject: [PATCH] test: relationship populates with locale --- test/localization/int.spec.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/localization/int.spec.ts b/test/localization/int.spec.ts index f30ef9789..980b5d269 100644 --- a/test/localization/int.spec.ts +++ b/test/localization/int.spec.ts @@ -318,6 +318,16 @@ describe('Localization', () => { expect(result2.docs[0].id).toEqual(withRelationship.id); }); + it('relationship population uses locale', async () => { + const result = await payload.findByID({ + collection: withLocalizedRelSlug, + depth: 1, + id: withRelationship.id, + locale: spanishLocale, + }); + expect((result.localizedRelationship as LocalizedPost).title).toEqual(relationSpanishTitle); + }); + it('all locales', async () => { const queryRelation = (where: Where) => { return payload.find({