@forestrie/mandate-ui-e2e-kit 0.2.0 → 0.2.1
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/burner.d.ts +20 -0
- package/dist/burner.d.ts.map +1 -0
- package/dist/burner.js +22 -0
- package/dist/console-fixture.d.ts +8 -0
- package/dist/console-fixture.d.ts.map +1 -0
- package/dist/console-fixture.js +12 -0
- package/dist/coordinator-bff.d.ts +12 -0
- package/dist/coordinator-bff.d.ts.map +1 -0
- package/dist/coordinator-bff.js +143 -0
- package/dist/e2e-wallet.d.ts +3 -0
- package/dist/e2e-wallet.d.ts.map +1 -0
- package/dist/e2e-wallet.js +2 -0
- package/dist/fixtures.d.ts +10 -0
- package/dist/fixtures.d.ts.map +1 -0
- package/dist/fixtures.js +28 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/privy-login.d.ts +10 -0
- package/dist/privy-login.d.ts.map +1 -0
- package/dist/privy-login.js +17 -0
- package/package.json +1 -1
package/dist/burner.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Page } from '@playwright/test';
|
|
2
|
+
/**
|
|
3
|
+
* Deploy-time / system-test burner-key seeding (plan-2607-01 D2, FOR-322).
|
|
4
|
+
* Mirrors how a system-test deployment pre-populates `localStorage` with a
|
|
5
|
+
* key minted out of band, so the operator/user starts already in control of
|
|
6
|
+
* `K(L)` and the exit gradient can run non-interactively.
|
|
7
|
+
*/
|
|
8
|
+
/** Must match `BURNER_KEY_STORAGE_KEY` in `@mandate/ui` local-burner-key.ts. */
|
|
9
|
+
export declare const BURNER_KEY_STORAGE_KEY = "mandate.burner.privateKey";
|
|
10
|
+
/** Fixed secp256k1 test key (scalar = 1); never used for anything real. */
|
|
11
|
+
export declare const E2E_BURNER_PRIVATE_KEY = "0x0000000000000000000000000000000000000000000000000000000000000001";
|
|
12
|
+
/** Address derived from `E2E_BURNER_PRIVATE_KEY` (well-known scalar-1 EOA). */
|
|
13
|
+
export declare const E2E_BURNER_ADDRESS = "0x7e5f4552091a69125d5dfcb7b8c2659029395bdf";
|
|
14
|
+
/**
|
|
15
|
+
* Seed the burner key into `localStorage` before any page script runs, so the
|
|
16
|
+
* delegation console loads already holding the key (no "Create burner" click).
|
|
17
|
+
* Registers an init script for every subsequent navigation on this page.
|
|
18
|
+
*/
|
|
19
|
+
export declare function seedBurnerKey(page: Page, privateKeyHex?: string): Promise<void>;
|
|
20
|
+
//# sourceMappingURL=burner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"burner.d.ts","sourceRoot":"","sources":["../src/burner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAE7C;;;;;GAKG;AAEH,gFAAgF;AAChF,eAAO,MAAM,sBAAsB,8BAA8B,CAAC;AAElE,2EAA2E;AAC3E,eAAO,MAAM,sBAAsB,uEACkC,CAAC;AAEtE,+EAA+E;AAC/E,eAAO,MAAM,kBAAkB,+CAA+C,CAAC;AAE/E;;;;GAIG;AACH,wBAAsB,aAAa,CAClC,IAAI,EAAE,IAAI,EACV,aAAa,GAAE,MAA+B,GAC5C,OAAO,CAAC,IAAI,CAAC,CAOf"}
|
package/dist/burner.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Deploy-time / system-test burner-key seeding (plan-2607-01 D2, FOR-322).
|
|
3
|
+
* Mirrors how a system-test deployment pre-populates `localStorage` with a
|
|
4
|
+
* key minted out of band, so the operator/user starts already in control of
|
|
5
|
+
* `K(L)` and the exit gradient can run non-interactively.
|
|
6
|
+
*/
|
|
7
|
+
/** Must match `BURNER_KEY_STORAGE_KEY` in `@mandate/ui` local-burner-key.ts. */
|
|
8
|
+
export const BURNER_KEY_STORAGE_KEY = 'mandate.burner.privateKey';
|
|
9
|
+
/** Fixed secp256k1 test key (scalar = 1); never used for anything real. */
|
|
10
|
+
export const E2E_BURNER_PRIVATE_KEY = '0x0000000000000000000000000000000000000000000000000000000000000001';
|
|
11
|
+
/** Address derived from `E2E_BURNER_PRIVATE_KEY` (well-known scalar-1 EOA). */
|
|
12
|
+
export const E2E_BURNER_ADDRESS = '0x7e5f4552091a69125d5dfcb7b8c2659029395bdf';
|
|
13
|
+
/**
|
|
14
|
+
* Seed the burner key into `localStorage` before any page script runs, so the
|
|
15
|
+
* delegation console loads already holding the key (no "Create burner" click).
|
|
16
|
+
* Registers an init script for every subsequent navigation on this page.
|
|
17
|
+
*/
|
|
18
|
+
export async function seedBurnerKey(page, privateKeyHex = E2E_BURNER_PRIVATE_KEY) {
|
|
19
|
+
await page.addInitScript(([storageKey, key]) => {
|
|
20
|
+
window.localStorage.setItem(storageKey, key);
|
|
21
|
+
}, [BURNER_KEY_STORAGE_KEY, privateKeyHex]);
|
|
22
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type CoordinatorMockOptions } from './coordinator-bff.js';
|
|
2
|
+
type ConsoleFixtures = {
|
|
3
|
+
consolePage: import('@playwright/test').Page;
|
|
4
|
+
mocks: CoordinatorMockOptions;
|
|
5
|
+
};
|
|
6
|
+
export declare const test: import("@playwright/test").TestType<import("@playwright/test").PlaywrightTestArgs & import("@playwright/test").PlaywrightTestOptions & ConsoleFixtures, import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions>;
|
|
7
|
+
export { expect } from '@playwright/test';
|
|
8
|
+
//# sourceMappingURL=console-fixture.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"console-fixture.d.ts","sourceRoot":"","sources":["../src/console-fixture.ts"],"names":[],"mappings":"AACA,OAAO,EAA2B,KAAK,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAG5F,KAAK,eAAe,GAAG;IACtB,WAAW,EAAE,OAAO,kBAAkB,EAAE,IAAI,CAAC;IAC7C,KAAK,EAAE,sBAAsB,CAAC;CAC9B,CAAC;AAEF,eAAO,MAAM,IAAI,+PAOf,CAAC;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { test as base } from '@playwright/test';
|
|
2
|
+
import { installCoordinatorMocks } from './coordinator-bff.js';
|
|
3
|
+
import { E2E_AUTH_LOG_ID } from './fixtures.js';
|
|
4
|
+
export const test = base.extend({
|
|
5
|
+
mocks: [{}, { option: true }],
|
|
6
|
+
consolePage: async ({ page, mocks }, use) => {
|
|
7
|
+
await installCoordinatorMocks(page, mocks);
|
|
8
|
+
await page.goto(`/delegations?authLogId=${encodeURIComponent(E2E_AUTH_LOG_ID)}`);
|
|
9
|
+
await use(page);
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
export { expect } from '@playwright/test';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Page } from '@playwright/test';
|
|
2
|
+
import type { EnabledResponse, PendingEntry, ProblemDetails } from '@mandate/coordinator-types';
|
|
3
|
+
export interface CoordinatorMockOptions {
|
|
4
|
+
pendingEntries?: PendingEntry[];
|
|
5
|
+
pendingError?: ProblemDetails;
|
|
6
|
+
certificateSubmitError?: ProblemDetails;
|
|
7
|
+
onCertificateSubmit?: (body: unknown) => void;
|
|
8
|
+
enabledByLogId?: Record<string, EnabledResponse>;
|
|
9
|
+
}
|
|
10
|
+
/** Install browser-level mocks for mandate BFF and control-plane auth routes. */
|
|
11
|
+
export declare function installCoordinatorMocks(page: Page, options?: CoordinatorMockOptions): Promise<void>;
|
|
12
|
+
//# sourceMappingURL=coordinator-bff.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coordinator-bff.d.ts","sourceRoot":"","sources":["../src/coordinator-bff.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,KAAK,EAIX,eAAe,EACf,YAAY,EAEZ,cAAc,EAEd,MAAM,4BAA4B,CAAC;AAEpC,MAAM,WAAW,sBAAsB;IACtC,cAAc,CAAC,EAAE,YAAY,EAAE,CAAC;IAChC,YAAY,CAAC,EAAE,cAAc,CAAC;IAC9B,sBAAsB,CAAC,EAAE,cAAc,CAAC;IACxC,mBAAmB,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAC9C,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;CACjD;AAiBD,iFAAiF;AACjF,wBAAsB,uBAAuB,CAC5C,IAAI,EAAE,IAAI,EACV,OAAO,GAAE,sBAA2B,GAClC,OAAO,CAAC,IAAI,CAAC,CA2If"}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
function defaultEnabled(enabled = true) {
|
|
2
|
+
return {
|
|
3
|
+
enabled,
|
|
4
|
+
userEnabled: enabled,
|
|
5
|
+
operatorEnabled: enabled
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
function problemJson(problem) {
|
|
9
|
+
return {
|
|
10
|
+
status: problem.status,
|
|
11
|
+
body: JSON.stringify(problem)
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
/** Install browser-level mocks for mandate BFF and control-plane auth routes. */
|
|
15
|
+
export async function installCoordinatorMocks(page, options = {}) {
|
|
16
|
+
const enabledState = new Map(Object.entries(options.enabledByLogId ?? {}));
|
|
17
|
+
let certificateSubmitCount = 0;
|
|
18
|
+
await page.route('**/api/auth/challenge', async (route) => {
|
|
19
|
+
if (route.request().method() !== 'POST') {
|
|
20
|
+
await route.fallback();
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
const body = route.request().postDataJSON();
|
|
24
|
+
const now = Math.floor(Date.now() / 1000);
|
|
25
|
+
const response = {
|
|
26
|
+
version: 'wcc-1',
|
|
27
|
+
nonce: 'e2e-nonce',
|
|
28
|
+
authLogId: body.authLogId,
|
|
29
|
+
scopes: body.scopes,
|
|
30
|
+
issuedAt: now,
|
|
31
|
+
expiresAt: now + 3600,
|
|
32
|
+
domain: '127.0.0.1',
|
|
33
|
+
coordinatorOrigin: 'http://127.0.0.1:4173'
|
|
34
|
+
};
|
|
35
|
+
await route.fulfill({
|
|
36
|
+
status: 200,
|
|
37
|
+
contentType: 'application/json',
|
|
38
|
+
body: JSON.stringify(response)
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
await page.route('**/api/auth/session', async (route) => {
|
|
42
|
+
if (route.request().method() !== 'POST') {
|
|
43
|
+
await route.fallback();
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
const body = route.request().postDataJSON();
|
|
47
|
+
const now = Math.floor(Date.now() / 1000);
|
|
48
|
+
const response = {
|
|
49
|
+
token: 'e2e-session-token',
|
|
50
|
+
expiresAt: now + 3600,
|
|
51
|
+
authLogId: body.envelope.authLogId,
|
|
52
|
+
scopes: body.envelope.scopes
|
|
53
|
+
};
|
|
54
|
+
await route.fulfill({
|
|
55
|
+
status: 200,
|
|
56
|
+
contentType: 'application/json',
|
|
57
|
+
body: JSON.stringify(response)
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
await page.route('**/api/coordinator/**', async (route) => {
|
|
61
|
+
const request = route.request();
|
|
62
|
+
const url = new URL(request.url());
|
|
63
|
+
const path = url.pathname.replace(/^.*\/api\/coordinator\//, '');
|
|
64
|
+
const method = request.method();
|
|
65
|
+
if (method === 'GET' && path.startsWith('delegations/pending')) {
|
|
66
|
+
if (options.pendingError) {
|
|
67
|
+
const { status, body } = problemJson(options.pendingError);
|
|
68
|
+
await route.fulfill({ status, contentType: 'application/problem+json', body });
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
const entries = options.pendingEntries ?? [];
|
|
72
|
+
const response = {
|
|
73
|
+
entries,
|
|
74
|
+
offset: 0,
|
|
75
|
+
limit: 50,
|
|
76
|
+
shardCount: 1
|
|
77
|
+
};
|
|
78
|
+
await route.fulfill({
|
|
79
|
+
status: 200,
|
|
80
|
+
contentType: 'application/json',
|
|
81
|
+
body: JSON.stringify(response)
|
|
82
|
+
});
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
if (method === 'POST' && path === 'delegations/certificate') {
|
|
86
|
+
if (options.certificateSubmitError) {
|
|
87
|
+
const { status, body } = problemJson(options.certificateSubmitError);
|
|
88
|
+
await route.fulfill({ status, contentType: 'application/problem+json', body });
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
certificateSubmitCount += 1;
|
|
92
|
+
options.onCertificateSubmit?.(request.postDataJSON());
|
|
93
|
+
const response = {
|
|
94
|
+
ok: true,
|
|
95
|
+
certificateKey: `e2e-cert-${certificateSubmitCount}`
|
|
96
|
+
};
|
|
97
|
+
await route.fulfill({
|
|
98
|
+
status: 200,
|
|
99
|
+
contentType: 'application/json',
|
|
100
|
+
body: JSON.stringify(response)
|
|
101
|
+
});
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
const enabledMatch = path.match(/^logs\/([^/]+)\/enabled$/);
|
|
105
|
+
if (enabledMatch) {
|
|
106
|
+
const logId = enabledMatch[1];
|
|
107
|
+
if (method === 'GET') {
|
|
108
|
+
const response = enabledState.get(logId) ?? defaultEnabled(true);
|
|
109
|
+
await route.fulfill({
|
|
110
|
+
status: 200,
|
|
111
|
+
contentType: 'application/json',
|
|
112
|
+
body: JSON.stringify(response)
|
|
113
|
+
});
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
if (method === 'PUT') {
|
|
117
|
+
const body = request.postDataJSON();
|
|
118
|
+
const response = {
|
|
119
|
+
enabled: body.enabled,
|
|
120
|
+
userEnabled: body.enabled,
|
|
121
|
+
operatorEnabled: body.enabled
|
|
122
|
+
};
|
|
123
|
+
enabledState.set(logId, response);
|
|
124
|
+
await route.fulfill({
|
|
125
|
+
status: 200,
|
|
126
|
+
contentType: 'application/json',
|
|
127
|
+
body: JSON.stringify(response)
|
|
128
|
+
});
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
await route.fulfill({
|
|
133
|
+
status: 404,
|
|
134
|
+
contentType: 'application/problem+json',
|
|
135
|
+
body: JSON.stringify({
|
|
136
|
+
type: 'about:blank',
|
|
137
|
+
title: 'Not Found',
|
|
138
|
+
status: 404,
|
|
139
|
+
detail: `Unmocked coordinator path: ${method} ${path}`
|
|
140
|
+
})
|
|
141
|
+
});
|
|
142
|
+
});
|
|
143
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"e2e-wallet.d.ts","sourceRoot":"","sources":["../src/e2e-wallet.ts"],"names":[],"mappings":"AAAA,mFAAmF;AACnF,eAAO,MAAM,uBAAuB,EAAG,4CAAqD,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { PendingEntry } from '@mandate/coordinator-types';
|
|
2
|
+
/** Authority log id used across hermetic ui specs. */
|
|
3
|
+
export declare const E2E_AUTH_LOG_ID = "11111111-1111-1111-1111-111111111111";
|
|
4
|
+
/** User log id for kill-switch specs. */
|
|
5
|
+
export declare const E2E_USER_LOG_ID = "b2c3d4e5f67890ab1234567890abcdef12";
|
|
6
|
+
/** Pre-generated P-256 COSE delegated public key (base64). */
|
|
7
|
+
export declare const SAMPLE_DELEGATED_PUBLIC_KEY_B64 = "pAECIAEh2EBYIAhdWHosXL4fALSX75DOf7YF5g862MUyZhGN4Bc4/MJxIthAWCCAtLh7eiOZqeqCchGbn8+uH6jjVty+tgnNSKJFv/16Cg==";
|
|
8
|
+
export declare function samplePendingEntry(overrides?: Partial<PendingEntry>): PendingEntry;
|
|
9
|
+
export declare function samplePendingEntries(count?: number): PendingEntry[];
|
|
10
|
+
//# sourceMappingURL=fixtures.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fixtures.d.ts","sourceRoot":"","sources":["../src/fixtures.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE/D,sDAAsD;AACtD,eAAO,MAAM,eAAe,yCAAyC,CAAC;AAEtE,yCAAyC;AACzC,eAAO,MAAM,eAAe,uCAAuC,CAAC;AAEpE,8DAA8D;AAC9D,eAAO,MAAM,+BAA+B,iHACmE,CAAC;AAEhH,wBAAgB,kBAAkB,CAAC,SAAS,GAAE,OAAO,CAAC,YAAY,CAAM,GAAG,YAAY,CAYtF;AAED,wBAAgB,oBAAoB,CAAC,KAAK,SAAI,GAAG,YAAY,EAAE,CAQ9D"}
|
package/dist/fixtures.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/** Authority log id used across hermetic ui specs. */
|
|
2
|
+
export const E2E_AUTH_LOG_ID = '11111111-1111-1111-1111-111111111111';
|
|
3
|
+
/** User log id for kill-switch specs. */
|
|
4
|
+
export const E2E_USER_LOG_ID = 'b2c3d4e5f67890ab1234567890abcdef12';
|
|
5
|
+
/** Pre-generated P-256 COSE delegated public key (base64). */
|
|
6
|
+
export const SAMPLE_DELEGATED_PUBLIC_KEY_B64 = 'pAECIAEh2EBYIAhdWHosXL4fALSX75DOf7YF5g862MUyZhGN4Bc4/MJxIthAWCCAtLh7eiOZqeqCchGbn8+uH6jjVty+tgnNSKJFv/16Cg==';
|
|
7
|
+
export function samplePendingEntry(overrides = {}) {
|
|
8
|
+
return {
|
|
9
|
+
id: 'entry-1',
|
|
10
|
+
authLogIdHex32: E2E_AUTH_LOG_ID.replace(/-/g, ''),
|
|
11
|
+
logIdHex32: E2E_USER_LOG_ID,
|
|
12
|
+
mmrStart: 1,
|
|
13
|
+
mmrEnd: 100,
|
|
14
|
+
delegatedPublicKeyHash: 'e2e-delegated-key-hash',
|
|
15
|
+
delegatedPublicKey: SAMPLE_DELEGATED_PUBLIC_KEY_B64,
|
|
16
|
+
requestedAt: 1_700_000_000,
|
|
17
|
+
...overrides
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export function samplePendingEntries(count = 2) {
|
|
21
|
+
const base = samplePendingEntry();
|
|
22
|
+
return Array.from({ length: count }, (_, i) => ({
|
|
23
|
+
...base,
|
|
24
|
+
id: `entry-${i + 1}`,
|
|
25
|
+
mmrStart: base.mmrStart + i * 10,
|
|
26
|
+
mmrEnd: base.mmrEnd + i * 10
|
|
27
|
+
}));
|
|
28
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { installCoordinatorMocks, type CoordinatorMockOptions } from './coordinator-bff.js';
|
|
2
|
+
export { E2E_AUTH_LOG_ID, E2E_USER_LOG_ID, SAMPLE_DELEGATED_PUBLIC_KEY_B64, samplePendingEntry, samplePendingEntries } from './fixtures.js';
|
|
3
|
+
export { E2E_MOCK_WALLET_ADDRESS } from './e2e-wallet.js';
|
|
4
|
+
export { BURNER_KEY_STORAGE_KEY, E2E_BURNER_ADDRESS, E2E_BURNER_PRIVATE_KEY, seedBurnerKey } from './burner.js';
|
|
5
|
+
export { E2E_EMAIL, E2E_OTP, loadPending, loginWithMockPrivy } from './privy-login.js';
|
|
6
|
+
export { expect, test } from './console-fixture.js';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,KAAK,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAC5F,OAAO,EACN,eAAe,EACf,eAAe,EACf,+BAA+B,EAC/B,kBAAkB,EAClB,oBAAoB,EACpB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EACN,sBAAsB,EACtB,kBAAkB,EAClB,sBAAsB,EACtB,aAAa,EACb,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACvF,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { installCoordinatorMocks } from './coordinator-bff.js';
|
|
2
|
+
export { E2E_AUTH_LOG_ID, E2E_USER_LOG_ID, SAMPLE_DELEGATED_PUBLIC_KEY_B64, samplePendingEntry, samplePendingEntries } from './fixtures.js';
|
|
3
|
+
export { E2E_MOCK_WALLET_ADDRESS } from './e2e-wallet.js';
|
|
4
|
+
export { BURNER_KEY_STORAGE_KEY, E2E_BURNER_ADDRESS, E2E_BURNER_PRIVATE_KEY, seedBurnerKey } from './burner.js';
|
|
5
|
+
export { E2E_EMAIL, E2E_OTP, loadPending, loginWithMockPrivy } from './privy-login.js';
|
|
6
|
+
export { expect, test } from './console-fixture.js';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Page } from '@playwright/test';
|
|
2
|
+
import { E2E_MOCK_WALLET_ADDRESS } from './e2e-wallet.js';
|
|
3
|
+
export declare const E2E_EMAIL = "e2e-operator@forestrie.dev";
|
|
4
|
+
export declare const E2E_OTP = "000000";
|
|
5
|
+
/** Drive the in-DOM Privy email OTP login flow (mock Privy accepts any code). */
|
|
6
|
+
export declare function loginWithMockPrivy(page: Page): Promise<void>;
|
|
7
|
+
/** Click Load pending on the delegation console. */
|
|
8
|
+
export declare function loadPending(page: Page): Promise<void>;
|
|
9
|
+
export { E2E_MOCK_WALLET_ADDRESS };
|
|
10
|
+
//# sourceMappingURL=privy-login.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"privy-login.d.ts","sourceRoot":"","sources":["../src/privy-login.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAE7C,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAE1D,eAAO,MAAM,SAAS,+BAA+B,CAAC;AACtD,eAAO,MAAM,OAAO,WAAW,CAAC;AAEhC,iFAAiF;AACjF,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAMlE;AAED,oDAAoD;AACpD,wBAAsB,WAAW,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAE3D;AAED,OAAO,EAAE,uBAAuB,EAAE,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { expect } from '@playwright/test';
|
|
2
|
+
import { E2E_MOCK_WALLET_ADDRESS } from './e2e-wallet.js';
|
|
3
|
+
export const E2E_EMAIL = 'e2e-operator@forestrie.dev';
|
|
4
|
+
export const E2E_OTP = '000000';
|
|
5
|
+
/** Drive the in-DOM Privy email OTP login flow (mock Privy accepts any code). */
|
|
6
|
+
export async function loginWithMockPrivy(page) {
|
|
7
|
+
await page.getByPlaceholder('Email for Privy login').fill(E2E_EMAIL);
|
|
8
|
+
await page.getByRole('button', { name: 'Send code' }).click();
|
|
9
|
+
await page.getByTestId('privy-otp').fill(E2E_OTP);
|
|
10
|
+
await page.getByRole('button', { name: 'Connect wallet' }).click();
|
|
11
|
+
await expect(page.getByText(`${E2E_MOCK_WALLET_ADDRESS.slice(0, 6)}`)).toBeVisible();
|
|
12
|
+
}
|
|
13
|
+
/** Click Load pending on the delegation console. */
|
|
14
|
+
export async function loadPending(page) {
|
|
15
|
+
await page.getByRole('button', { name: 'Load pending' }).click();
|
|
16
|
+
}
|
|
17
|
+
export { E2E_MOCK_WALLET_ADDRESS };
|