diff --git a/Cargo.lock b/Cargo.lock index 488f3b4a756db..c3b07170d6df8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -11449,6 +11449,7 @@ dependencies = [ "tokio", "tower", "tower-http", + "uuid", "workspace-hack", ] diff --git a/apps/wallet/src/background/auto-lock-accounts.ts b/apps/wallet/src/background/auto-lock-accounts.ts index 82de82746aed6..8e44af92a653a 100644 --- a/apps/wallet/src/background/auto-lock-accounts.ts +++ b/apps/wallet/src/background/auto-lock-accounts.ts @@ -40,5 +40,5 @@ export const notifyUserActive = throttle( () => { setupAutoLockAlarm(); }, - { noLeading: true }, + { noTrailing: true }, ); diff --git a/apps/wallet/src/ui/app/components/accounts/AutoLockSelector.tsx b/apps/wallet/src/ui/app/components/accounts/AutoLockSelector.tsx index 5576d425c6bfd..136e7c44e4c85 100644 --- a/apps/wallet/src/ui/app/components/accounts/AutoLockSelector.tsx +++ b/apps/wallet/src/ui/app/components/accounts/AutoLockSelector.tsx @@ -63,6 +63,7 @@ export function AutoLockSelector({ disabled }: AutoLockSelectorProps) { disabled={disabled || !timerEnabled} type="number" {...register('autoLock.timer')} + data-testid="auto-lock-timer" /> {isLoading ? ( diff --git a/apps/wallet/src/ui/app/index.tsx b/apps/wallet/src/ui/app/index.tsx index 653419dbc6f79..9a3e616d73cae 100644 --- a/apps/wallet/src/ui/app/index.tsx +++ b/apps/wallet/src/ui/app/index.tsx @@ -66,7 +66,7 @@ const HIDDEN_MENU_PATHS = [ '/apps/disconnectapp', ]; -const notifyUserActiveInterval = 15 * 1000; // 15 seconds +const notifyUserActiveInterval = 5 * 1000; // 5 seconds const App = () => { const dispatch = useAppDispatch(); @@ -137,9 +137,13 @@ const App = () => { if (!autoLockEnabled) { return; } - const sendUpdateThrottled = throttle(notifyUserActiveInterval, () => { - backgroundClient.notifyUserActive(); - }); + const sendUpdateThrottled = throttle( + notifyUserActiveInterval, + () => { + backgroundClient.notifyUserActive(); + }, + { noTrailing: true }, + ); document.addEventListener('mousemove', sendUpdateThrottled); document.addEventListener('keydown', sendUpdateThrottled); return () => { diff --git a/apps/wallet/tests/balanceChanges.spec.ts b/apps/wallet/tests/balanceChanges.spec.ts index 9b6655425ac37..94f4e17398d84 100644 --- a/apps/wallet/tests/balanceChanges.spec.ts +++ b/apps/wallet/tests/balanceChanges.spec.ts @@ -5,8 +5,6 @@ import { expect, test } from './fixtures'; import { createWallet, importWallet } from './utils/auth'; import { generateKeypairFromMnemonic, requestSuiFromFaucet } from './utils/localnet'; -test.skip(); - const receivedAddressMnemonic = [ 'beef', 'beef', @@ -40,12 +38,14 @@ const currentWalletMnemonic = [ const COIN_TO_SEND = 20; test('request SUI from local faucet', async ({ page, extensionUrl }) => { + const timeout = 30_000; + test.setTimeout(timeout); await createWallet(page, extensionUrl); await page.getByRole('navigation').getByRole('link', { name: 'Coins' }).click(); const originalBalance = await page.getByTestId('coin-balance').textContent(); await page.getByTestId('faucet-request-button').click(); - await expect(page.getByText(/SUI Received/i)).toBeVisible(); + await expect(page.getByText(/SUI Received/i)).toBeVisible({ timeout }); await expect(page.getByTestId('coin-balance')).not.toHaveText(`${originalBalance}SUI`); }); diff --git a/apps/wallet/tests/demo-app/src/index.tsx b/apps/wallet/tests/demo-app/src/index.tsx index 42dfe89059ad3..f2529770a9f92 100644 --- a/apps/wallet/tests/demo-app/src/index.tsx +++ b/apps/wallet/tests/demo-app/src/index.tsx @@ -93,7 +93,7 @@ function App() {