Skip to content

Commit

Permalink
Improve e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
NSeydoux committed Dec 17, 2024
1 parent 496b877 commit 7248b7a
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions e2e/node/e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ import * as sc from "@inrupt/solid-client";
import { custom } from "openid-client";
import type { AccessGrant, AccessRequest } from "../../src/index";
import {
DURATION,

Check failure on line 55 in e2e/node/e2e.test.ts

View workflow job for this annotation

GitHub Actions / lint / lint

'DURATION' is defined but never used
approveAccessRequest,
createContainerInContainer,
denyAccessRequest,
Expand Down Expand Up @@ -1714,7 +1715,7 @@ describe(`End-to-end access grant tests for environment [${environment}] `, () =
},
);

describe.only("query endpoint", () => {
describe("query endpoint", () => {
it("can navigate the paginated results", async () => {
const allCredentialsPageOne = await query(
{ pageSize: 10 },
Expand All @@ -1739,25 +1740,28 @@ describe(`End-to-end access grant tests for environment [${environment}] `, () =
expect(allCredentialsPageTwo.items).toHaveLength(10);
});

it("can filter based on credential type", async () => {
const allGrantsPageOne = await query(
it("can filter based on one or more criteria", async () => {
const onType = await query(
{ type: "SolidAccessGrant" },
{
fetch: addUserAgent(requestorSession.fetch, TEST_USER_AGENT),
// FIXME add query endpoint discovery check.
queryEndpoint: new URL("query", vcProvider),
},
);
expect(allGrantsPageOne.items).not.toHaveLength(0);
const allGrantsPageOne = await query(
{ type: "SolidAccessGrant" },
expect(onType.items).not.toHaveLength(0);
const onTypeAndStatus = await query(
{ type: "SolidAccessGrant", status: "Active" },
{
fetch: addUserAgent(requestorSession.fetch, TEST_USER_AGENT),
// FIXME add query endpoint discovery check.
queryEndpoint: new URL("query", vcProvider),
},
);
expect(allGrantsPageOne.items).not.toHaveLength(0);
expect(onTypeAndStatus.items).not.toHaveLength(0);
expect(onTypeAndStatus.items.length).toBeLessThanOrEqual(
onType.items.length,
);
});
});
});

0 comments on commit 7248b7a

Please sign in to comment.