Skip to content

Commit

Permalink
Fix browser test app
Browse files Browse the repository at this point in the history
  • Loading branch information
NSeydoux committed Dec 13, 2024
1 parent d1d2638 commit ad066ce
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions e2e/browser/test-app/components/accessGrants/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ export default function AccessController({
setErrorMessage: (msg: string) => void;
}) {
const [accessGrant, setAccessGrant] = useState<AccessGrant>();
const [accessRequestUrl, setAccessRequestUrl] = useState<string>();
const [accessRequest, setAccessRequest] = useState<DatasetWithId>();
const [sharedResourceIri, setSharedResourceIri] = useState<string>();
const [customInt, setCustomInt] = useState<number>();
Expand Down Expand Up @@ -176,6 +177,7 @@ export default function AccessController({
},
);
setAccessRequest(accessRequestReturned);
setAccessRequestUrl(accessRequestReturned.id);
};

const handleRevoke = async () => {
Expand All @@ -199,15 +201,20 @@ export default function AccessController({
};

const handleAccessRequest = async () => {
if (accessRequestUrl === undefined || URL.canParse(accessRequestUrl)) {
console.error(

Check warning on line 205 in e2e/browser/test-app/components/accessGrants/index.tsx

View workflow job for this annotation

GitHub Actions / lint / lint

Unexpected console statement
"Please issue an Access Request and provide its URL before being redirected.",
);
return;
}
await redirectToAccessManagementUi(
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
accessRequest!,
accessRequestUrl,
`http://localhost:3000/`,
{
redirectCallback: (url: string) => {
window.location.replace(url);
},
fallbackAccessManagementUi: "http://localhost:3001/accessRequest/", // `https://amc.inrupt.com/accessRequest/`,
fallbackAccessManagementUi: "https://amc.inrupt.com/accessRequest/",
fetch: session.fetch,
},
);
Expand Down Expand Up @@ -310,9 +317,9 @@ export default function AccessController({
id="request-id"
data-testid="access-request-id"
placeholder="Access Request URL"
// onChange={(e) => {
// setAccessRequest(e.currentTarget.value);
// }}
onChange={(e) => {
setAccessRequestUrl(e.currentTarget.value);
}}
/>
</p>
<div>
Expand Down

0 comments on commit ad066ce

Please sign in to comment.