Skip to content

Commit 566d621

Browse files
committed
Tests: disambiguate vault password toggle, stabilize health ping
1 parent 2ede7ee commit 566d621

4 files changed

Lines changed: 13 additions & 12 deletions

File tree

desktop/src/renderer/App.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9844,12 +9844,13 @@ function App() {
98449844
placeholder={pipVaultSnapshot?.mode === "password" ? "Enter vault password" : "Set a vault password"}
98459845
aria-label="Vault password"
98469846
aria-describedby="vault-password-help"
9847+
data-testid="vault-password-input"
98479848
/>
98489849
<button
98499850
type="button"
98509851
className="ghost small password-visibility-toggle"
98519852
onClick={() => setPipVaultPasswordVisible((visible) => !visible)}
9852-
aria-label={`${pipVaultPasswordVisible ? "Hide" : "Show"} vault password`}
9853+
aria-label="Toggle password visibility"
98539854
>
98549855
{pipVaultPasswordVisible ? "Hide" : "Show"}
98559856
</button>
@@ -9948,7 +9949,7 @@ function App() {
99489949
type="button"
99499950
className="ghost small password-visibility-toggle"
99509951
onClick={() => setVaultResetCurrentVisible((visible) => !visible)}
9951-
aria-label={`${vaultResetCurrentVisible ? "Hide" : "Show"} current password`}
9952+
aria-label="Toggle current password visibility"
99529953
>
99539954
{vaultResetCurrentVisible ? "Hide" : "Show"}
99549955
</button>
@@ -9971,7 +9972,7 @@ function App() {
99719972
type="button"
99729973
className="ghost small password-visibility-toggle"
99739974
onClick={() => setVaultResetNewVisible((visible) => !visible)}
9974-
aria-label={`${vaultResetNewVisible ? "Hide" : "Show"} new password`}
9975+
aria-label="Toggle new password visibility"
99759976
>
99769977
{vaultResetNewVisible ? "Hide" : "Show"}
99779978
</button>
@@ -9994,7 +9995,7 @@ function App() {
99949995
type="button"
99959996
className="ghost small password-visibility-toggle"
99969997
onClick={() => setVaultResetConfirmVisible((visible) => !visible)}
9997-
aria-label={`${vaultResetConfirmVisible ? "Hide" : "Show"} confirmation`}
9998+
aria-label="Toggle confirmation visibility"
99989999
>
999910000
{vaultResetConfirmVisible ? "Hide" : "Show"}
1000010001
</button>
@@ -12454,7 +12455,7 @@ function App() {
1245412455
type="button"
1245512456
className="ghost small password-visibility-toggle"
1245612457
onClick={() => setPipVaultPasswordVisible((visible) => !visible)}
12457-
aria-label={`${pipVaultPasswordVisible ? "Hide" : "Show"} vault password`}
12458+
aria-label="Toggle password visibility"
1245812459
>
1245912460
{pipVaultPasswordVisible ? "Hide" : "Show"}
1246012461
</button>

desktop/tests/helpers.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ export async function suppressPointerInterceptors(page: Page) {
327327
});
328328
}
329329

330-
export async function goHome(page: Page, attempts = 3) {
330+
export async function goHome(page: Page, attempts = 6) {
331331
for (let i = 0; i < attempts; i += 1) {
332332
try {
333333
await page.goto("/");
@@ -339,7 +339,7 @@ export async function goHome(page: Page, attempts = 3) {
339339
return;
340340
} catch (err) {
341341
if (i === attempts - 1) throw err;
342-
await page.waitForTimeout(500);
342+
await page.waitForTimeout(1000);
343343
}
344344
}
345345
}

desktop/tests/smoke.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ test.describe("Desktop renderer smoke", () => {
218218
const treeFirst = page.locator(".tree-card").first();
219219
// Fallback for flaky drag: click the add button if nothing was dropped.
220220
if (!(await treeFirst.isVisible({ timeout: 2000 }).catch(() => false))) {
221-
await gridCard.getByRole("button", { name: "Add" }).click();
221+
await gridCard.getByRole("button", { name: "Add", exact: true }).click();
222222
}
223223

224224
await expect(treeFirst).toBeVisible();
@@ -245,7 +245,7 @@ test.describe("Desktop renderer smoke", () => {
245245
const healthCard = page.locator(".health-card");
246246
await expect(healthCard).toBeVisible();
247247
await healthCard.getByRole("button", { name: "Expand" }).click();
248-
await page.getByLabel("Health auto refresh cadence").selectOption("10");
248+
await page.getByLabel("Health ping interval").selectOption("10");
249249
await healthCard.getByRole("button", { name: "Refresh" }).click();
250250

251251
const schedulerRow = healthCard.locator(".health-row").filter({ hasText: "AO scheduler" });
@@ -260,7 +260,7 @@ test.describe("Desktop renderer smoke", () => {
260260
await page.waitForFunction(
261261
(target) => document.querySelectorAll(".health-events-list .health-event").length > target,
262262
initial,
263-
{ timeout: 5_000 },
263+
{ timeout: 15_000 },
264264
);
265265
});
266266

desktop/tests/vault.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const openVaultPanel = async (page: Page, options?: Parameters<typeof setupPage>
1313
};
1414

1515
const unlockVault = async (page: Page) => {
16-
await page.getByLabel("Vault password").fill(TEST_PASSWORD);
16+
await page.getByTestId("vault-password-input").fill(TEST_PASSWORD);
1717
await page.getByTestId("vault-unlock-btn").click();
1818
await expect(page.locator(".pip-vault-header-actions")).toContainText("Unlocked");
1919
};
@@ -54,7 +54,7 @@ test.describe("Vault password and Argon2 UI", () => {
5454
);
5555

5656
await openVaultPanel(page);
57-
await page.getByLabel("Vault password").fill(TEST_PASSWORD);
57+
await page.getByTestId("vault-password-input").fill(TEST_PASSWORD);
5858
await page.getByRole("button", { name: "Run breach check" }).click();
5959

6060
const breachPill = page.locator(".pip-vault-breach .pill");

0 commit comments

Comments
 (0)