Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
AVtheking committed Jan 8, 2024
1 parent 1507ee5 commit 07b5bc2
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion tests/resolvers/Query/organizationsConnection.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,17 @@ beforeAll(async () => {
creator: testUser?._id,
admins: [testUser?._id],
members: [testUser?._id],
userRegistrationRequired: true,
visibleInSearch: true,
apiUrl: `apiUrl${nanoid()}`,
},
{
name: `name${nanoid()}`,
description: `description${nanoid()}`,
creator: testUser?._id,
admins: [testUser?._id],
userRegistrationRequired: false,
visibleInSearch: false,
members: [testUser?._id],
apiUrl: `apiUrl${nanoid()}`,
},
Expand All @@ -41,6 +45,8 @@ beforeAll(async () => {
description: `description${nanoid()}`,
creator: testUser?._id,
admins: [testUser?._id],
userRegistrationRequired: true,
visibleInSearch: true,
members: [testUser?._id],
apiUrl: `apiUrl${nanoid()}`,
},
Expand Down Expand Up @@ -109,7 +115,7 @@ describe("resolvers -> Query -> organizationsConnection", () => {
it(`returns paginated list of all existing organizations filtered by args.where ===
{ id: testOrganizations[1]._id, name: testOrganizations[1].name,
description: testOrganizations[1].description, apiUrl: testOrganizations[1].apiUrl,
visibleInSearch: testOrganizations[1].visibleInSearch, isPublic: testOrganizations[1].isPublic }
visibleInSearch: testOrganizations[1].visibleInSearch, userRegistrationRequired: testOrganizations[1].userRegistrationRequired }
and sorted by ascending order of organization._id if args.orderBy === 'id_ASC'`, async () => {
const sort = {
_id: 1,
Expand All @@ -120,6 +126,8 @@ describe("resolvers -> Query -> organizationsConnection", () => {
name: testOrganizations[1].name,
description: testOrganizations[1].description,
apiUrl: testOrganizations[1].apiUrl,
visibleInSearch: testOrganizations[1].visibleInSearch,
userRegistrationRequired: testOrganizations[1].userRegistrationRequired,
};

const args: QueryOrganizationsConnectionArgs = {
Expand All @@ -130,6 +138,8 @@ describe("resolvers -> Query -> organizationsConnection", () => {
name: testOrganizations[1].name,
description: testOrganizations[1].description,
apiUrl: testOrganizations[1].apiUrl,
visibleInSearch: testOrganizations[1].visibleInSearch,
userRegistrationRequired: testOrganizations[1].userRegistrationRequired,
},
orderBy: "id_ASC",
};
Expand Down

0 comments on commit 07b5bc2

Please sign in to comment.