Skip to content

Commit cc5d9fe

Browse files
committed
fix(e2e): apply remaining CodeRabbit follow-ups
1 parent 27e0b6f commit cc5d9fe

4 files changed

Lines changed: 11 additions & 2 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ dist/
55
.DS_Store
66
playwright-report/
77
test-results/
8+
.env.playwright-live

e2e/deterministic.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ test.describe('Deterministic UI E2E (mock mode)', () => {
8585
await expect(page.getByText('Manage Keys')).toBeVisible();
8686

8787
await page.click('#add-manage-key-btn');
88-
await page.locator('.manage-disable-key-checkbox').first().check();
88+
await page.locator('.manage-disable-key-checkbox').first().click({ force: true });
8989
await expect(page.getByText('Will add 1 key, disable 1 key')).toBeVisible();
9090

9191
await page.click('#apply-manage-btn');

src/main.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ import type {
101101
DpnsUsernameEntry,
102102
DpnsRegistrationResult,
103103
IdentityPublicKeyInfo,
104+
E2EMockWindow,
104105
} from './types.js';
105106
import {
106107
E2E_MOCK_DPNS_WIF,
@@ -115,7 +116,6 @@ let dapiClient: DAPIClient;
115116

116117
const E2E_MOCK_ADVANCE_TIMEOUT_MS = 30000;
117118
const E2E_MOCK_BUILD_ENABLED = !import.meta.env.PROD;
118-
type E2EMockWindow = Window & { __e2eMockAdvance?: () => void };
119119

120120
function isE2EMockMode(): boolean {
121121
if (!E2E_MOCK_BUILD_ENABLED) {
@@ -1036,6 +1036,12 @@ function setupEventListeners(container: HTMLElement) {
10361036
const refreshedState = resetManageStateAndRefresh(state);
10371037
updateState(refreshedState);
10381038

1039+
if (isE2EMockMode()) {
1040+
await delay(30);
1041+
updateState(setManageIdentityFetched(refreshedState, createE2EMockIdentityKeys()));
1042+
return;
1043+
}
1044+
10391045
// Refetch identity keys from the network
10401046
const targetId = refreshedState.targetIdentityId;
10411047
if (targetId) {

src/types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ export interface KeyPair {
33
publicKey: Uint8Array;
44
}
55

6+
export type E2EMockWindow = Window & { __e2eMockAdvance?: () => void };
7+
68
export interface UTXO {
79
txid: string;
810
vout: number;

0 commit comments

Comments
 (0)