@terpjs/conformance 0.9.0 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -38,6 +38,16 @@ export declare function login(page: Page, credentials?: {
38
38
  * user menu (avatar at the bottom of every Terp app's sidebar) opens Settings and Sign out;
39
39
  * sign-out revokes the token server-side (ADR 0031), so this is reusable across apps. Success
40
40
  * is the app shell being replaced by the sign-in screen.
41
+ *
42
+ * The trigger is located by its marker rather than by an accessible name, and that is a fix
43
+ * rather than a shortcut. The name is deliberately not fixed: expanded, the button renders the
44
+ * user's own email and role as visible text and takes its name from them, because an
45
+ * `aria-label` REPLACES subtree text in the accessible name and would leave a voice-control
46
+ * user with nothing to say that matches what they see (WCAG 2.5.3, Label in Name). Only the
47
+ * collapsed icon rail carries a label, where the avatar is aria-hidden and the button would
48
+ * otherwise have no name at all. So the name varies with the shell state AND with the signed-in
49
+ * user, which makes it the wrong axis for an app-agnostic helper; `data-terp` is the stable one,
50
+ * being a pinned inventory whose renames are release notes.
41
51
  */
42
52
  export declare function logout(page: Page): Promise<void>;
43
53
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAErD;;;;;GAKG;AACH,eAAO,MAAM,KAAK;;;CAGjB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,MAAM;;;CAGlB,CAAC;AAEF,eAAO,MAAM,MAAM;;;CAGlB,CAAC;AAEF;;;;;GAKG;AACH,wBAAsB,KAAK,CACzB,IAAI,EAAE,IAAI,EACV,WAAW,GAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAU,GACvD,OAAO,CAAC,IAAI,CAAC,CASf;AAED;;;;;GAKG;AACH,wBAAsB,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAItD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAErD;;;;;GAKG;AACH,eAAO,MAAM,KAAK;;;CAGjB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,MAAM;;;CAGlB,CAAC;AAEF,eAAO,MAAM,MAAM;;;CAGlB,CAAC;AAEF;;;;;GAKG;AACH,wBAAsB,KAAK,CACzB,IAAI,EAAE,IAAI,EACV,WAAW,GAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAU,GACvD,OAAO,CAAC,IAAI,CAAC,CAef;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAItD"}
package/dist/index.js CHANGED
@@ -32,8 +32,14 @@ export const VIEWER = {
32
32
  export async function login(page, credentials = ADMIN) {
33
33
  await page.goto("/");
34
34
  await expect(page.getByRole("heading", { name: "Sign in" })).toBeVisible();
35
- await page.getByPlaceholder("Email").fill(credentials.email);
36
- await page.getByPlaceholder("Password").fill(credentials.password);
35
+ // By LABEL, not by placeholder. The login fields were placeholder-only until the labels
36
+ // landed, and a placeholder was the only handle they had — which is the same defect from
37
+ // the other side: a name that vanishes the moment a user types is not a name. Selecting
38
+ // the way a user perceives the field is also what keeps this suite honest about
39
+ // accessibility, since a field with no accessible name now fails here rather than being
40
+ // reachable by a workaround.
41
+ await page.getByLabel("Email", { exact: true }).fill(credentials.email);
42
+ await page.getByLabel("Password", { exact: true }).fill(credentials.password);
37
43
  await page.getByRole("button", { name: "Sign in" }).click();
38
44
  await expect(page.getByRole("heading", { name: "Sign in" })).toHaveCount(0, {
39
45
  timeout: 15_000,
@@ -44,9 +50,19 @@ export async function login(page, credentials = ADMIN) {
44
50
  * user menu (avatar at the bottom of every Terp app's sidebar) opens Settings and Sign out;
45
51
  * sign-out revokes the token server-side (ADR 0031), so this is reusable across apps. Success
46
52
  * is the app shell being replaced by the sign-in screen.
53
+ *
54
+ * The trigger is located by its marker rather than by an accessible name, and that is a fix
55
+ * rather than a shortcut. The name is deliberately not fixed: expanded, the button renders the
56
+ * user's own email and role as visible text and takes its name from them, because an
57
+ * `aria-label` REPLACES subtree text in the accessible name and would leave a voice-control
58
+ * user with nothing to say that matches what they see (WCAG 2.5.3, Label in Name). Only the
59
+ * collapsed icon rail carries a label, where the avatar is aria-hidden and the button would
60
+ * otherwise have no name at all. So the name varies with the shell state AND with the signed-in
61
+ * user, which makes it the wrong axis for an app-agnostic helper; `data-terp` is the stable one,
62
+ * being a pinned inventory whose renames are release notes.
47
63
  */
48
64
  export async function logout(page) {
49
- await page.getByRole("button", { name: "Account menu" }).click();
65
+ await page.locator('[data-terp="user-menu"] [data-terp="menu-trigger"]').click();
50
66
  await page.getByRole("menuitem", { name: "Sign out" }).click();
51
67
  await expect(page.getByRole("heading", { name: "Sign in" })).toBeVisible();
52
68
  }
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAa,MAAM,kBAAkB,CAAC;AAErD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG;IACnB,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC,oBAAoB,IAAI,iBAAiB;IAC5D,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,uBAAuB,IAAI,8BAA8B;CAChF,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC,qBAAqB,IAAI,kBAAkB;IAC9D,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,w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CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IACxE,MAAM,IAAI,CAAC,UAAU,CAAC,UAAU,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;IAC9E,MAAM,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC;IAC5D,MAAM,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,EAAE;QAC1E,OAAO,EAAE,MAAM;KAChB,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,KAAK,UAAU,MAAM,CAAC,IAAU;IACrC,MAAM,IAAI,CAAC,OAAO,CAAC,oDAAoD,CAAC,CAAC,KAAK,EAAE,CAAC;IACjF,MAAM,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC;IAC/D,MAAM,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;AAC7E,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@terpjs/conformance",
3
- "version": "0.9.0",
3
+ "version": "0.11.0",
4
4
  "type": "module",
5
5
  "description": "Terp conformance \u2014 app-agnostic Playwright end-to-end flows over a running Terp stack (base profile: auth gating + session lifecycle) plus the login/role helpers an app's own e2e suite composes.",
6
6
  "main": "./dist/index.js",