From ea98efe149ea06174ea94e09f8ae547e91c40e4a Mon Sep 17 00:00:00 2001 From: Agnes Lin Date: Fri, 20 Sep 2019 15:26:55 -0400 Subject: [PATCH] test: add a scope test for resolver --- ...elongs-to.inclusion-resolver.relation.acceptance.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/repository-tests/src/crud/relations/acceptance/belongs-to.inclusion-resolver.relation.acceptance.ts b/packages/repository-tests/src/crud/relations/acceptance/belongs-to.inclusion-resolver.relation.acceptance.ts index 110d05e282d3..fa350f457a1c 100644 --- a/packages/repository-tests/src/crud/relations/acceptance/belongs-to.inclusion-resolver.relation.acceptance.ts +++ b/packages/repository-tests/src/crud/relations/acceptance/belongs-to.inclusion-resolver.relation.acceptance.ts @@ -165,6 +165,16 @@ export function belongsToInclusionResolverAcceptance( expect(toJSON(result)).to.deepEqual(toJSON(expected)); }); + it('throws error if the inclusion query contains a non-empty scope', async () => { + await orderRepo.create({ + description: 'shiba', + customerId: existingCustomerId, + }); + expect( + orderRepo.find({include: [{relation: 'customer'}], limit: 1}), + ).to.be.rejectedWith(`Invalid "scope is not supported`); + }); + it('throws error if the target repository does not have the registered resolver', async () => { await orderRepo.create({ description: 'shiba',