From bb0121dc91de70273d7464296d11c6161953462d Mon Sep 17 00:00:00 2001 From: lukaw3d Date: Tue, 16 May 2023 07:23:17 +0200 Subject: [PATCH] Stricter types in tests --- cypress/e2e/encryption-unit-tests.cy.ts | 3 ++- playwright/utils/mockApi.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) 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/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, }), }) })