Skip to content

Commit

Permalink
Stricter types in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaw3d committed May 18, 2023
1 parent d0e1fc2 commit bb0121d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
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
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

0 comments on commit bb0121d

Please sign in to comment.