Skip to content

Commit ffd7f6c

Browse files
committed
Update e2e tests to match permission sets usage
1 parent 990ef2b commit ffd7f6c

2 files changed

Lines changed: 20 additions & 16 deletions

File tree

e2e/step-definitions/consent.steps.ts

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -45,24 +45,28 @@ Then('a consent screen is displayed', async function (this: EpdsWorld) {
4545
timeout: 30_000,
4646
})
4747

48-
// 2. The demo clients request `atproto transition:generic`. For that
49-
// scope set, @atproto/oauth-provider-ui's ScopeDescription renders
50-
// multiple permission cards — including one titled "Authenticate"
51-
// via the RpcMethodsDetails component, which fires on
52-
// hasTransitionGeneric. Assert that card is visible: this proves
53-
// the scope was actually parsed and rendered a permission summary,
54-
// not that the page loaded blank with just an Authorize button.
48+
// 2. The demo clients request two granular permission sets —
49+
// `include:org.hypercerts.authWrite` and `include:app.certified.authWrite`.
50+
// @atproto/oauth-provider-ui's ScopeDescription resolves each
51+
// permission-set lexicon and renders a permission card titled from the
52+
// set's `title` field ("Manage your Hypercerts data" / "Manage your
53+
// Certified data"). Assert those cards are visible: this proves the
54+
// scopes were actually parsed, the permission-set lexicons resolved, and
55+
// a permission summary rendered — not that the page loaded blank with
56+
// just an Authorize button.
5557
//
56-
// We deliberately do NOT assert on the raw scope strings
57-
// (`atproto`, `transition:generic`) being visible on the page —
58-
// those only appear inside a collapsed "Technical details"
59-
// <Admonition> panel that is hidden (HTML `hidden` attribute +
60-
// aria-hidden="true") until the user clicks its disclosure
61-
// button. Asserting on the user-facing scope card is both more
62-
// meaningful (what users actually see) and more resilient
58+
// We deliberately do NOT assert on the raw scope strings (`atproto`,
59+
// `include:...`) being visible on the page — those only appear inside a
60+
// collapsed "Technical details" <Admonition> panel that is hidden (HTML
61+
// `hidden` attribute + aria-hidden="true") until the user clicks its
62+
// disclosure button. Asserting on the user-facing permission cards is
63+
// both more meaningful (what users actually see) and more resilient
6364
// (doesn't depend on the details-panel implementation).
6465
await expect(
65-
page.getByRole('heading', { name: 'Authenticate' }),
66+
page.getByRole('heading', { name: 'Manage your Hypercerts data' }),
67+
).toBeVisible()
68+
await expect(
69+
page.getByRole('heading', { name: 'Manage your Certified data' }),
6670
).toBeVisible()
6771
})
6872

e2e/step-definitions/sec-fetch-site.steps.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ When(
3333
client_id: clientMetaUrl,
3434
redirect_uri: `${testEnv.demoUrl}/api/oauth/callback`,
3535
response_type: 'code',
36-
scope: 'atproto transition:generic',
36+
scope: 'atproto include:org.hypercerts.authWrite include:app.certified.authWrite',
3737
state: 'test-state',
3838
code_challenge: 'E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM',
3939
code_challenge_method: 'S256',

0 commit comments

Comments
 (0)