Skip to content

Commit

Permalink
test: fix grant tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dragosp1011 committed Jan 5, 2024
1 parent d28103f commit a6590e9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion packages/auth/src/graphql/resolvers/grant.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ describe('Grant Resolvers', (): void => {
const grant = await createGrant(deps)
grants.push(grant)
}
grants.reverse()

const query = await appContainer.apolloClient
.query({
Expand Down Expand Up @@ -173,6 +174,8 @@ describe('Grant Resolvers', (): void => {
grants.push(grant)
}

const filteredGrants = grants.slice(0, 2).reverse()

const filter = {
identifier: {
in: [identifier]
Expand Down Expand Up @@ -205,7 +208,7 @@ describe('Grant Resolvers', (): void => {
})
expect(query.edges).toHaveLength(2)
query.edges.forEach((edge, idx) => {
const grant = grants[idx]
const grant = filteredGrants[idx]
expect(edge.cursor).toEqual(grant.id)
expect(edge.node).toEqual({
__typename: 'Grant',
Expand Down
2 changes: 1 addition & 1 deletion packages/auth/src/graphql/resolvers/page.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export const getPageTests = <T extends Model, M extends BaseModel>({
for (let i = 0; i < 50; i++) {
models.push(await createModel())
}
return models
return models.reverse()
}

test('pageInfo is correct on default query without params', async (): Promise<void> => {
Expand Down

0 comments on commit a6590e9

Please sign in to comment.