diff --git a/cypress/e2e/encryption-unit-tests.cy.ts b/cypress/e2e/encryption-unit-tests.cy.ts index 411fd36697..4044917d33 100644 --- a/cypress/e2e/encryption-unit-tests.cy.ts +++ b/cypress/e2e/encryption-unit-tests.cy.ts @@ -1,4 +1,5 @@ import { decryptWithPassword, deriveKeyFromPassword, encryptWithKey, fromBase64andParse } from 'app/state/persist/encryption' +import { EncryptedObject } from '../../src/app/state/persist/types' describe('encryption unit tests in browser', () => { const PASSWORD = 'abcd1234&' @@ -46,7 +47,7 @@ describe('encryption unit tests in browser', () => { 142, 84, 1, 34, 155, 63, 246, 170, 198, 16, 253, 87, 59, 140, 165, 209, 70, 123, 52, 63, 209, 79, 137, 18, 116, 123, 27, 86, 153, 221, 206, 34, ]), - }) + } satisfies EncryptedObject) const decrypted = await decryptWithPassword(PASSWORD, encryptedString) expect(decrypted).deep.equal(DATA) diff --git a/playwright/tests/syncTabs.spec.ts b/playwright/tests/syncTabs.spec.ts index 2cdc2a4802..74ee4a480e 100644 --- a/playwright/tests/syncTabs.spec.ts +++ b/playwright/tests/syncTabs.spec.ts @@ -244,9 +244,6 @@ test.describe('syncTabs', () => { page, context, }) => { - // TODO: https://github.com/oasisprotocol/oasis-wallet-web/pull/975#discussion_r1019567305 - test.fail() - await addPersistedStorage(page) await page.goto('/') await page.getByPlaceholder('Enter your password here').fill(password) @@ -256,6 +253,8 @@ test.describe('syncTabs', () => { await page.getByRole('button', { name: /Private key/ }).click() const tab2 = await context.newPage() await tab2.goto('/') + await expect(tab2.getByText('Loading account')).toBeVisible() + await expect(tab2.getByText('Loading account')).toBeHidden() // Delay getBalance so addWallet is called after wallet is locked. let grpcBalance: Route @@ -269,6 +268,9 @@ test.describe('syncTabs', () => { body: 'AAAAAAGggAAAAB5ncnBjLXN0YXR1czowDQpncnBjLW1lc3NhZ2U6DQo=', }) - await expect(page.getByTestId('fatalerror-stacktrace')).toBeHidden() + // TODO: https://github.com/oasisprotocol/oasis-wallet-web/pull/975#discussion_r1019567305 + // await expect(page.getByTestId('fatalerror-stacktrace')).toBeHidden() + await expect(page.getByTestId('fatalerror-stacktrace')).toBeVisible() + await page.close() // Just to avoid expectNoFatal in afterEach }) }) diff --git a/playwright/utils/mockApi.ts b/playwright/utils/mockApi.ts index 882943ab61..2963821113 100644 --- a/playwright/utils/mockApi.ts +++ b/playwright/utils/mockApi.ts @@ -1,4 +1,5 @@ import { BrowserContext, Page } from '@playwright/test' +import type { AccountsRow } from '../../src/vendors/oasisscan/index' export async function mockApi(context: BrowserContext | Page, balance: number) { await context.route('**/chain/account/info/*', route => { @@ -14,7 +15,7 @@ export async function mockApi(context: BrowserContext | Page, balance: number) { total: '0', nonce: 1, allowances: [], - }, + } satisfies AccountsRow, }), }) })