Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
tudddorrr committed Oct 3, 2024
1 parent ee4c022 commit c0dbbf4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/services/player-group/indexPinned.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 (<EntityManager>global.em).persistAndFlush(pinned)

const res = await request(global.app)
Expand Down

0 comments on commit c0dbbf4

Please sign in to comment.