diff --git a/e2e/browser/test-app/components/accessGrants/index.tsx b/e2e/browser/test-app/components/accessGrants/index.tsx index eee31fb3e..4651cb4a9 100644 --- a/e2e/browser/test-app/components/accessGrants/index.tsx +++ b/e2e/browser/test-app/components/accessGrants/index.tsx @@ -20,12 +20,19 @@ // import { getDefaultSession } from "@inrupt/solid-client-authn-browser"; -import type { AccessGrant } from "@inrupt/solid-client-access-grants"; +import type { + AccessGrant, + DatasetWithId, +} from "@inrupt/solid-client-access-grants"; import { issueAccessRequest, redirectToAccessManagementUi, getAccessGrant, cancelAccessRequest, + getCustomFields, + getResourceOwner, + getResources, + getAccessModes, } from "@inrupt/solid-client-access-grants"; import { getPodUrlAll, @@ -33,20 +40,68 @@ import { getSourceUrl, deleteFile, } from "@inrupt/solid-client"; -import React, { useState } from "react"; +import React, { useEffect, useState } from "react"; import { useRouter } from "next/router"; const session = getDefaultSession(); const SHARED_FILE_CONTENT = "Some content.\n"; +function AccessCredential({ + vc, + testId, +}: { + vc: DatasetWithId | undefined; + testId: "access-request" | "access-grant"; +}) { + if (vc === undefined) { + return undefined; + } + return ( +
+ Resource owner:{" "} + {getResourceOwner(vc)} +
++ Requested resources:{" "} + {getResources(vc)} +
++ Requested modes:{" "} + + {JSON.stringify(getAccessModes(vc))} + +
++ Custom fields:{" "} + + {JSON.stringify(getCustomFields(vc))} + +
++ Custom fields:{" "} +
+Access Request to Approve:{" "} { - setAccessRequest(e.currentTarget.value); - }} + // onChange={(e) => { + // setAccessRequest(e.currentTarget.value); + // }} />
- Issued access request:{" "} -
- {accessRequest && JSON.stringify(accessRequest, null, 2)} -+ Issued access request:
- Granted access:{" "} -
- {accessGrant && JSON.stringify(accessGrant, null, 2)} -+ Granted access: