diff --git a/playwright/tests/extension.spec.ts b/playwright/tests/extension.spec.ts index 6bd438f69f..4712d8c5b8 100644 --- a/playwright/tests/extension.spec.ts +++ b/playwright/tests/extension.spec.ts @@ -8,7 +8,7 @@ import { privateKey, privateKeyAddress } from '../../src/utils/__fixtures__/test test.beforeEach(async ({ context }) => { await warnSlowApi(context) - await mockApi(context, 0) + await mockApi(context, '0') }) test.describe('The extension popup should load', () => { diff --git a/playwright/tests/home.spec.ts b/playwright/tests/home.spec.ts index 320094badd..a45d16845c 100644 --- a/playwright/tests/home.spec.ts +++ b/playwright/tests/home.spec.ts @@ -4,7 +4,7 @@ import { mockApi } from '../utils/mockApi' test.beforeEach(async ({ context }) => { await warnSlowApi(context) - await mockApi(context, 0) + await mockApi(context, '0') }) test.describe('The homepage should load', () => { diff --git a/playwright/tests/paraTimes.spec.ts b/playwright/tests/paraTimes.spec.ts index 41ae5d6b7e..ffd20cf0f0 100644 --- a/playwright/tests/paraTimes.spec.ts +++ b/playwright/tests/paraTimes.spec.ts @@ -6,7 +6,7 @@ import { mockApi } from '../utils/mockApi' test.beforeEach(async ({ page }) => { await warnSlowApi(page) - await mockApi(page, 500000000000) + await mockApi(page, '500000000000') }) test.describe('ParaTimes', () => { diff --git a/playwright/tests/persist.spec.ts b/playwright/tests/persist.spec.ts index fdb26e374c..81a4f4bc1d 100644 --- a/playwright/tests/persist.spec.ts +++ b/playwright/tests/persist.spec.ts @@ -17,7 +17,7 @@ import { fillPrivateKeyWithoutPassword, fillPrivateKeyAndPassword } from '../uti test.beforeEach(async ({ context, page }) => { await warnSlowApi(context) - await mockApi(context, 0) + await mockApi(context, '0') await clearPersistedStorage(page, '/app.webmanifest') }) @@ -141,14 +141,14 @@ test.describe('Persist', () => { }) => { await addPersistedStorageV1(page, '/app.webmanifest') await page.goto('/') - await mockApi(context, 123) + await mockApi(context, '123000000000') await page.getByPlaceholder('Enter your password', { exact: true }).fill(password) await page.keyboard.press('Enter') await expect(page).toHaveURL(new RegExp(`/account/${privateKeyAddress}`)) await expect(page.getByTestId('account-balance-summary')).toContainText('123.0') await expect(page.getByTestId('account-balance-summary')).toContainText('ROSE') await page.getByRole('button', { name: /Lock profile/ }).click() - await mockApi(context, 456) + await mockApi(context, '456000000000') await page.getByPlaceholder('Enter your password', { exact: true }).fill(password) await page.keyboard.press('Enter') await expect(page.getByTestId('account-balance-summary')).toContainText('456.0') diff --git a/playwright/tests/preventSavingInputsToDisk/chromium.spec.ts b/playwright/tests/preventSavingInputsToDisk/chromium.spec.ts index 655005dc18..db9e2d86f4 100644 --- a/playwright/tests/preventSavingInputsToDisk/chromium.spec.ts +++ b/playwright/tests/preventSavingInputsToDisk/chromium.spec.ts @@ -13,7 +13,7 @@ const test = testWithUserDataDir(chromium) test.beforeEach(async ({ context }) => { await warnSlowApi(context) - await mockApi(context, 0) + await mockApi(context, '0') }) test('Chromium expect mnemonic, privateKey, and password to NOT leak with preventSavingInputsToUserData', async ({ diff --git a/playwright/tests/preventSavingInputsToDisk/firefox.spec.ts b/playwright/tests/preventSavingInputsToDisk/firefox.spec.ts index 7349094b75..5f116ae437 100644 --- a/playwright/tests/preventSavingInputsToDisk/firefox.spec.ts +++ b/playwright/tests/preventSavingInputsToDisk/firefox.spec.ts @@ -13,7 +13,7 @@ const test = testWithUserDataDir(firefox) test.beforeEach(async ({ context }) => { await warnSlowApi(context) - await mockApi(context, 0) + await mockApi(context, '0') }) test('Firefox expect mnemonic, privateKey, and password to NOT leak with preventSavingInputsToUserData', async ({ diff --git a/playwright/tests/refreshing-balance.spec.ts b/playwright/tests/refreshing-balance.spec.ts index 9be7883037..af3db6c87e 100644 --- a/playwright/tests/refreshing-balance.spec.ts +++ b/playwright/tests/refreshing-balance.spec.ts @@ -6,7 +6,7 @@ import { mockApi } from '../utils/mockApi' test.beforeEach(async ({ page }) => { await warnSlowApi(page) - await mockApi(page, 123) + await mockApi(page, '123000000000') await page.goto('/open-wallet/private-key') await fillPrivateKeyWithoutPassword(page, { @@ -24,7 +24,7 @@ test('Account selector should refresh balances on network change', async ({ page await expect(page.getByTestId('account-choice')).toContainText('123.0') await page.getByRole('button', { name: /Select/ }).click() - await mockApi(page, 456) + await mockApi(page, '456000000000') await page.getByTestId('network-selector').click() await page.getByRole('menuitem', { name: 'Testnet' }).click() await page.getByTestId('account-selector').click() @@ -37,9 +37,9 @@ test('Accounts page should continuously refresh balance', async ({ page }) => { await page.getByTestId('account-selector').click() await expect(page.getByTestId('account-balance-summary')).toContainText('123.0') await expect(page.getByTestId('account-choice')).toContainText('123.0') - await mockApi(page, 456) - await page.waitForRequest('**/chain/account/info/*', { timeout: 60_000 }) - await page.waitForRequest('**/chain/transactions*', { timeout: 60_000 }) + await mockApi(page, '456000000000') + await page.waitForRequest('**/consensus/accounts/*', { timeout: 60_000 }) + await page.waitForRequest('**/consensus/transactions?*', { timeout: 60_000 }) await expect(page.getByTestId('account-balance-summary')).toContainText('456.0') await expect(page.getByTestId('account-choice')).toContainText('456.0') // If balance in AccountSelector is not refreshed then making transactions with new balance will fail. @@ -51,7 +51,7 @@ test('Accounts page should refresh balance on navigation', async ({ page }) => { await expect(page.getByTestId('account-choice')).toContainText('123.0') await page.getByRole('button', { name: /Select/ }).click() await page.getByRole('link', { name: /Home/ }).click() - await mockApi(page, 456) + await mockApi(page, '456000000000') await page.getByTestId('nav-myaccount').click() await page.getByTestId('account-selector').click() await expect(page.getByTestId('account-balance-summary')).toContainText('456.0') diff --git a/playwright/tests/syncTabs.spec.ts b/playwright/tests/syncTabs.spec.ts index 29933ede0e..b9aea55e67 100644 --- a/playwright/tests/syncTabs.spec.ts +++ b/playwright/tests/syncTabs.spec.ts @@ -12,11 +12,11 @@ import { } from '../../src/utils/__fixtures__/test-inputs' import { addPersistedStorageV1, clearPersistedStorage } from '../utils/storage' import { fillPrivateKeyWithoutPassword, fillPrivateKeyAndPassword } from '../utils/fillPrivateKey' -import type { AccountsRow } from '../../src/vendors/oasisscan/index' +import type { Account } from '../../src/vendors/nexus/index' test.beforeEach(async ({ context, page }) => { await warnSlowApi(context) - await mockApi(context, 0) + await mockApi(context, '0') await clearPersistedStorage(page, '/app.webmanifest') }) @@ -312,7 +312,7 @@ test.describe('syncTabs', () => { // Delay getAccountBalanceWithFallback so addWallet is called after wallet is locked. let apiBalance: Route - await context.route('**/chain/account/info/*', route => (apiBalance = route)) + await context.route('**/consensus/accounts/*', route => (apiBalance = route)) await page.getByPlaceholder('Enter your private key here').fill(privateKey2) await page.keyboard.press('Enter') @@ -321,15 +321,18 @@ test.describe('syncTabs', () => { body: JSON.stringify({ code: 0, data: { - rank: 0, address: '', available: '0', escrow: '0', debonding: '0', - total: '0', nonce: 1, allowances: [], - } satisfies AccountsRow, + delegations_balance: '0', + debonding_delegations_balance: '0', + stats: { + num_txns: 1, + }, + } satisfies Account, }), }) await page.waitForTimeout(100) diff --git a/playwright/tests/transfer.spec.ts b/playwright/tests/transfer.spec.ts index 188123f5cc..b2acafbf96 100644 --- a/playwright/tests/transfer.spec.ts +++ b/playwright/tests/transfer.spec.ts @@ -6,7 +6,7 @@ import { mockApi } from '../utils/mockApi' test.beforeEach(async ({ page }) => { await warnSlowApi(page) - await mockApi(page, 123) + await mockApi(page, '123000000000') await page.goto('/open-wallet/private-key') await fillPrivateKeyWithoutPassword(page, { diff --git a/playwright/tests/validators.spec.ts b/playwright/tests/validators.spec.ts index ee4a1697be..ec02ab1323 100644 --- a/playwright/tests/validators.spec.ts +++ b/playwright/tests/validators.spec.ts @@ -7,9 +7,9 @@ import { expectNoErrorsInConsole } from '../utils/expectNoErrorsInConsole' test.beforeEach(async ({ page }) => { await warnSlowApi(page) - await mockApi(page, 500000000000) + await mockApi(page, '500000000000') // Unmock validators list API - await page.unroute('**/validator/list?*') + await page.unroute('**/consensus/validators') await expectNoErrorsInConsole(page, { ignoreError: message => { // Some validator icons need authentication @@ -38,8 +38,8 @@ test.describe('Validators', () => { await page.getByRole('link', { name: 'Stake' }).click() // Wait for validators to be shown, then scroll to them to trigger lazy loading. - await expect(page.getByText('Everstake')).toBeVisible() - await page.getByText('Everstake').scrollIntoViewIfNeeded() + await expect(page.getByText('stakefish')).toBeVisible() + await page.getByText('stakefish').scrollIntoViewIfNeeded() await (await someValidatorIconPromise).finished() // Expect no errors. })