mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-10 13:22:14 +00:00
test: anchor sharing release journeys
This commit is contained in:
1 parent
bd6220bbba
commit
feb9d25e87
5 files changed
+98
-2
No files matched your search
@@ -0,0 +1,11 @@
|
||||
import { expect, test } from "@playwright/test";
|
||||
|
||||
import { ACCESSIBILITY_STATES } from "../tests/fixtures/v137/e2e-journeys";
|
||||
|
||||
test.describe("sharing accessibility anchors", () => {
|
||||
for (const state of ACCESSIBILITY_STATES) {
|
||||
test(`anchor: ${state.name}`, () => {
|
||||
expect(state.contract).toBe("inventory-only");
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,11 @@
|
||||
import { expect, test } from "@playwright/test";
|
||||
|
||||
import { RELEASE_JOURNEYS } from "../tests/fixtures/v137/e2e-journeys";
|
||||
|
||||
test.describe("sharing release journey anchors", () => {
|
||||
for (const journey of RELEASE_JOURNEYS) {
|
||||
test(`anchor: ${journey.name}`, () => {
|
||||
expect(journey.contract).toBe("inventory-only");
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -1,3 +1,6 @@
|
||||
import { readFileSync } from "node:fs";
|
||||
import { join } from "node:path";
|
||||
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import {
|
||||
@@ -10,6 +13,10 @@ import {
|
||||
NOTIFICATION_CHANNELS,
|
||||
NOTIFICATION_DELIVERY_MATRIX,
|
||||
} from "../../tests/fixtures/v137/notification-matrix";
|
||||
import {
|
||||
ACCESSIBILITY_STATES,
|
||||
RELEASE_JOURNEYS,
|
||||
} from "../../tests/fixtures/v137/e2e-journeys";
|
||||
|
||||
describe("sharing and handler inventories", () => {
|
||||
it("freezes the exact sharing-domain vocabulary", () => {
|
||||
@@ -78,7 +85,7 @@ describe("security principals and compatibility", () => {
|
||||
expect(
|
||||
NOTIFICATION_DELIVERY_MATRIX.every(
|
||||
({ interactive, recipientUserId, recordUserId }) =>
|
||||
!interactive && recipientUserId !== recordUserId,
|
||||
!interactive && String(recipientUserId) !== String(recordUserId),
|
||||
),
|
||||
).toBe(true);
|
||||
});
|
||||
@@ -97,3 +104,28 @@ describe("security principals and compatibility", () => {
|
||||
expect(LEGACY_ACCOUNT_PAYLOADS[3]?.legacyDecoder).toBe("deny");
|
||||
});
|
||||
});
|
||||
|
||||
describe("journey and accessibility inventory", () => {
|
||||
it("names every release journey and accessibility state exactly once", () => {
|
||||
expect(RELEASE_JOURNEYS).toHaveLength(8);
|
||||
expect(ACCESSIBILITY_STATES).toHaveLength(5);
|
||||
expect(new Set(RELEASE_JOURNEYS.map(({ name }) => name)).size).toBe(
|
||||
RELEASE_JOURNEYS.length,
|
||||
);
|
||||
expect(new Set(ACCESSIBILITY_STATES.map(({ name }) => name)).size).toBe(
|
||||
ACCESSIBILITY_STATES.length,
|
||||
);
|
||||
});
|
||||
|
||||
it("leaves the browser anchors discoverable without focused or skipped cases", () => {
|
||||
const anchorFiles = [
|
||||
"v137-sharing-managed-profiles.spec.ts",
|
||||
"v137-sharing-managed-profiles-a11y.spec.ts",
|
||||
];
|
||||
|
||||
for (const file of anchorFiles) {
|
||||
const source = readFileSync(join(process.cwd(), "e2e", file), "utf8");
|
||||
expect(source).not.toMatch(/\b(?:test|describe)\.(?:only|skip)\b/);
|
||||
}
|
||||
});
|
||||
});
|
||||
Vendored
+42
@@ -0,0 +1,42 @@
|
||||
export const RELEASE_JOURNEYS = [
|
||||
{
|
||||
name: "adult-full-read-scoped-read-write-and-manage",
|
||||
contract: "inventory-only",
|
||||
},
|
||||
{
|
||||
name: "manage-mutation-activity-and-fenced-settings",
|
||||
contract: "inventory-only",
|
||||
},
|
||||
{
|
||||
name: "managed-profile-two-guardian-lifecycle",
|
||||
contract: "inventory-only",
|
||||
},
|
||||
{
|
||||
name: "two-guardian-two-record-notification-delivery",
|
||||
contract: "inventory-only",
|
||||
},
|
||||
{
|
||||
name: "revoked-manage-idempotency-replay",
|
||||
contract: "inventory-only",
|
||||
},
|
||||
{
|
||||
name: "delegate-provider-no-egress-owner-positive",
|
||||
contract: "inventory-only",
|
||||
},
|
||||
{
|
||||
name: "durable-import-actor-attribution",
|
||||
contract: "inventory-only",
|
||||
},
|
||||
{
|
||||
name: "legacy-client-compatibility",
|
||||
contract: "inventory-only",
|
||||
},
|
||||
] as const;
|
||||
|
||||
export const ACCESSIBILITY_STATES = [
|
||||
{ name: "success", contract: "inventory-only" },
|
||||
{ name: "empty", contract: "inventory-only" },
|
||||
{ name: "loading", contract: "inventory-only" },
|
||||
{ name: "error", contract: "inventory-only" },
|
||||
{ name: "refusal", contract: "inventory-only" },
|
||||
] as const;
|
||||
+1
-1
@@ -65,7 +65,7 @@ export async function mutateThenRestore<T>(
|
||||
mutate: () => Promise<T>,
|
||||
restore: (result: T) => Promise<void>,
|
||||
): Promise<T> {
|
||||
let result: T;
|
||||
let result: T | undefined;
|
||||
let completed = false;
|
||||
|
||||
try {
|
||||
|
||||
Reference in new issue
Block a user