Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stricter unfixed crash test #1467

Merged
merged 2 commits into from
May 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cypress/e2e/encryption-unit-tests.cy.ts
Original file line number Diff line number Diff line change
@@ -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&'
Expand Down Expand Up @@ -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<typeof DATA>(PASSWORD, encryptedString)
expect(decrypted).deep.equal(DATA)
Expand Down
10 changes: 6 additions & 4 deletions playwright/tests/syncTabs.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand All @@ -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
})
})
3 changes: 2 additions & 1 deletion playwright/utils/mockApi.ts
Original file line number Diff line number Diff line change
@@ -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 => {
Expand All @@ -14,7 +15,7 @@ export async function mockApi(context: BrowserContext | Page, balance: number) {
total: '0',
nonce: 1,
allowances: [],
},
} satisfies AccountsRow,
}),
})
})
Expand Down