Skip to content

Commit

Permalink
Fix browser-based test
Browse files Browse the repository at this point in the history
  • Loading branch information
NSeydoux committed Dec 13, 2024
1 parent ad066ce commit 0ad70a6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 4 additions & 2 deletions e2e/browser/test-app/components/accessGrants/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ function AccessCredential({
</p>
<p>
Custom fields:{" "}
<span data-testid="crendential-custom">
<span data-testid="credential-custom">
{JSON.stringify(getCustomFields(vc))}
</span>
</p>
Expand Down Expand Up @@ -189,6 +189,7 @@ export default function AccessController({
fetch: session.fetch,
});
setAccessRequest(undefined);
setAccessRequestUrl(undefined);
};

const handleCallAuthedGrant = async () => {
Expand All @@ -201,7 +202,7 @@ export default function AccessController({
};

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

Check warning on line 206 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.",
);
Expand Down Expand Up @@ -320,6 +321,7 @@ export default function AccessController({
onChange={(e) => {
setAccessRequestUrl(e.currentTarget.value);
}}
value={accessRequestUrl}
/>
</p>
<div>
Expand Down
6 changes: 3 additions & 3 deletions e2e/browser/test/e2e.playwright.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ test("Redirect to AMC to accept Access Request", async ({
]);
});

test("Issue an access request, then revoking the access request", async ({
test.only("Issue an access request, then revoking the access request", async ({

Check failure on line 101 in e2e/browser/test/e2e.playwright.ts

View workflow job for this annotation

GitHub Actions / lint / lint

Unexpected focused test
page,
auth,
}) => {
Expand All @@ -117,7 +117,7 @@ test("Issue an access request, then revoking the access request", async ({

// Issue an access request to the resource.
await page.getByTestId("issue-access").click();
await expect(page.getByTestId("access-request")).resolves.not.toBeEmpty();
await expect(page.getByTestId("access-request")).not.toBeEmpty();
const customFields = await page
.getByTestId("credential-custom")
.textContent();
Expand All @@ -127,7 +127,7 @@ test("Issue an access request, then revoking the access request", async ({

// Revoke the access request.
await page.getByTestId("revoke-access").click();
await expect(page.getByTestId("access-request")).toBeEmpty();
await expect(page.getByTestId("access-request")).toBeHidden();

// Cleanup the resource
await page.getByTestId("delete-resource").click();
Expand Down

0 comments on commit 0ad70a6

Please sign in to comment.