From c0dbbf4e1f64b51ef13cc7a91f49985ee049d71b Mon Sep 17 00:00:00 2001 From: tudor <7089284+tudddorrr@users.noreply.github.com> Date: Thu, 3 Oct 2024 21:07:02 +0100 Subject: [PATCH] fix test --- tests/services/player-group/indexPinned.test.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/services/player-group/indexPinned.test.ts b/tests/services/player-group/indexPinned.test.ts index c1fb5c8c..087297eb 100644 --- a/tests/services/player-group/indexPinned.test.ts +++ b/tests/services/player-group/indexPinned.test.ts @@ -3,13 +3,18 @@ import request from 'supertest' import createOrganisationAndGame from '../../utils/createOrganisationAndGame' import createUserAndToken from '../../utils/createUserAndToken' import UserPinnedGroupFactory from '../../fixtures/UserPinnedGroupFactory' +import PlayerGroupFactory from '../../fixtures/PlayerGroupFactory' describe('Player group service - index pinned', () => { it('should return a list of groups', async () => { const [organisation, game] = await createOrganisationAndGame() const [token, user] = await createUserAndToken({}, organisation) - const pinned = await new UserPinnedGroupFactory().state(() => ({ user })).many(3) + const pinned = await new UserPinnedGroupFactory() + .state(() => ({ user })) + .state(async () => ({ group: await new PlayerGroupFactory().construct(game).one() })) + .many(3) + await (global.em).persistAndFlush(pinned) const res = await request(global.app)