diff --git a/playwright/tests/extension.spec.ts b/playwright/tests/extension.spec.ts index 17937e1f26..e315bf3e57 100644 --- a/playwright/tests/extension.spec.ts +++ b/playwright/tests/extension.spec.ts @@ -4,7 +4,7 @@ import { warnSlowApi } from '../utils/warnSlowApi' import { mockApi } from '../utils/mockApi' import { expectNoErrorsInConsole } from '../utils/expectNoErrorsInConsole' import { fillPrivateKeyWithoutPassword } from '../utils/fillPrivateKey' -import { privateKey, privateKeyAddress } from '../utils/test-inputs' +import { privateKey, privateKeyAddress } from '../../src/utils/__fixtures__/test-inputs' // Test dev build by default, but also allow testing production const extensionPath = path.join(__dirname, '..', process.env.EXTENSION_PATH ?? '../build-dev/') diff --git a/playwright/tests/fiat.spec.ts b/playwright/tests/fiat.spec.ts index a5bd5d7984..2fbd8e7c4c 100644 --- a/playwright/tests/fiat.spec.ts +++ b/playwright/tests/fiat.spec.ts @@ -1,5 +1,5 @@ import { test, expect, Page } from '@playwright/test' -import { privateKey, privateKeyAddress } from '../utils/test-inputs' +import { privateKey, privateKeyAddress } from '../../src/utils/__fixtures__/test-inputs' import { fillPrivateKeyWithoutPassword } from '../utils/fillPrivateKey' import { warnSlowApi } from '../utils/warnSlowApi' import { mockApi } from '../utils/mockApi' diff --git a/playwright/tests/migrating-persisted-state.spec.ts b/playwright/tests/migrating-persisted-state.spec.ts index d117cdd3ec..6ab6fc8bdd 100644 --- a/playwright/tests/migrating-persisted-state.spec.ts +++ b/playwright/tests/migrating-persisted-state.spec.ts @@ -3,7 +3,7 @@ import { mockApi } from '../utils/mockApi' import { warnSlowApi } from '../utils/warnSlowApi' import { expectNoFatal } from '../utils/expectNoFatal' import { addPersistedStorage, clearPersistedStorage } from '../utils/storage' -import { password, privateKeyUnlockedState } from '../utils/test-inputs' +import { password, privateKeyUnlockedState } from '../../src/utils/__fixtures__/test-inputs' import { RootState } from '../../src/types/RootState' test.beforeEach(async ({ context, page }) => { diff --git a/playwright/tests/paraTimes.spec.ts b/playwright/tests/paraTimes.spec.ts index b97910ee31..bd79932448 100644 --- a/playwright/tests/paraTimes.spec.ts +++ b/playwright/tests/paraTimes.spec.ts @@ -1,5 +1,5 @@ import { test, expect } from '@playwright/test' -import { privateKey, privateKeyAddress } from '../utils/test-inputs' +import { privateKey, privateKeyAddress } from '../../src/utils/__fixtures__/test-inputs' import { fillPrivateKeyWithoutPassword } from '../utils/fillPrivateKey' import { warnSlowApi } from '../utils/warnSlowApi' import { mockApi } from '../utils/mockApi' diff --git a/playwright/tests/persist.spec.ts b/playwright/tests/persist.spec.ts index 669acb1ee5..6dfa11f322 100644 --- a/playwright/tests/persist.spec.ts +++ b/playwright/tests/persist.spec.ts @@ -12,7 +12,7 @@ import { privateKey2, password, wrongPassword, -} from '../utils/test-inputs' +} from '../../src/utils/__fixtures__/test-inputs' import { fillPrivateKeyWithoutPassword, fillPrivateKeyAndPassword } from '../utils/fillPrivateKey' test.beforeEach(async ({ context, page }) => { diff --git a/playwright/tests/preventSavingInputsToDisk/chromium.spec.ts b/playwright/tests/preventSavingInputsToDisk/chromium.spec.ts index d429564c70..3cb2d338da 100644 --- a/playwright/tests/preventSavingInputsToDisk/chromium.spec.ts +++ b/playwright/tests/preventSavingInputsToDisk/chromium.spec.ts @@ -1,5 +1,5 @@ import { expect, chromium } from '@playwright/test' -import { mnemonic, password, privateKey } from '../../utils/test-inputs' +import { mnemonic, password, privateKey } from '../../../src/utils/__fixtures__/test-inputs' import { warnSlowApi } from '../../utils/warnSlowApi' import { mockApi } from '../../utils/mockApi' import { diff --git a/playwright/tests/preventSavingInputsToDisk/firefox.spec.ts b/playwright/tests/preventSavingInputsToDisk/firefox.spec.ts index ee194a4e61..aae5f12fdc 100644 --- a/playwright/tests/preventSavingInputsToDisk/firefox.spec.ts +++ b/playwright/tests/preventSavingInputsToDisk/firefox.spec.ts @@ -1,5 +1,5 @@ import { expect, firefox } from '@playwright/test' -import { mnemonic, password, privateKey } from '../../utils/test-inputs' +import { mnemonic, password, privateKey } from '../../../src/utils/__fixtures__/test-inputs' import { warnSlowApi } from '../../utils/warnSlowApi' import { mockApi } from '../../utils/mockApi' import { diff --git a/playwright/tests/refreshing-balance.spec.ts b/playwright/tests/refreshing-balance.spec.ts index e4de4886ce..01c16fa138 100644 --- a/playwright/tests/refreshing-balance.spec.ts +++ b/playwright/tests/refreshing-balance.spec.ts @@ -1,5 +1,5 @@ import { test, expect } from '@playwright/test' -import { privateKey, privateKeyAddress } from '../utils/test-inputs' +import { privateKey, privateKeyAddress } from '../../src/utils/__fixtures__/test-inputs' import { fillPrivateKeyWithoutPassword } from '../utils/fillPrivateKey' import { warnSlowApi } from '../utils/warnSlowApi' import { mockApi } from '../utils/mockApi' diff --git a/playwright/tests/syncTabs.spec.ts b/playwright/tests/syncTabs.spec.ts index 5ec646177d..9468e28600 100644 --- a/playwright/tests/syncTabs.spec.ts +++ b/playwright/tests/syncTabs.spec.ts @@ -9,7 +9,7 @@ import { privateKey2, privateKey2AddressPretty, mnemonic, -} from '../utils/test-inputs' +} from '../../src/utils/__fixtures__/test-inputs' import { addPersistedStorage, clearPersistedStorage } from '../utils/storage' import { fillPrivateKeyWithoutPassword, fillPrivateKeyAndPassword } from '../utils/fillPrivateKey' import type { AccountsRow } from '../../src/vendors/oasisscan/index' diff --git a/playwright/tests/toolbar.spec.ts b/playwright/tests/toolbar.spec.ts index 8826289c40..eb7aa0c0f0 100644 --- a/playwright/tests/toolbar.spec.ts +++ b/playwright/tests/toolbar.spec.ts @@ -1,5 +1,11 @@ import { test, expect, Page } from '@playwright/test' -import { mnemonic, mnemonicAddress0, password, privateKey, privateKeyAddress } from '../utils/test-inputs' +import { + mnemonic, + mnemonicAddress0, + password, + privateKey, + privateKeyAddress, +} from '../../src/utils/__fixtures__/test-inputs' import { fillPrivateKeyAndPassword } from '../utils/fillPrivateKey' import { warnSlowApi } from '../utils/warnSlowApi' import { mockApi } from '../utils/mockApi' diff --git a/playwright/tests/validators.spec.ts b/playwright/tests/validators.spec.ts index 6916d603d7..40c892ffd5 100644 --- a/playwright/tests/validators.spec.ts +++ b/playwright/tests/validators.spec.ts @@ -1,5 +1,5 @@ import { test, expect } from '@playwright/test' -import { privateKey, privateKeyAddress } from '../utils/test-inputs' +import { privateKey, privateKeyAddress } from '../../src/utils/__fixtures__/test-inputs' import { fillPrivateKeyWithoutPassword } from '../utils/fillPrivateKey' import { warnSlowApi } from '../utils/warnSlowApi' import { mockApi } from '../utils/mockApi' diff --git a/playwright/utils/fillPrivateKey.ts b/playwright/utils/fillPrivateKey.ts index 54e1534e91..3f647dba45 100644 --- a/playwright/utils/fillPrivateKey.ts +++ b/playwright/utils/fillPrivateKey.ts @@ -1,5 +1,5 @@ import { expect, test, Page } from '@playwright/test' -import { password, privateKey, privateKeyAddress } from './test-inputs' +import { password, privateKey, privateKeyAddress } from '../../src/utils/__fixtures__/test-inputs' export async function fillPrivateKeyWithoutPassword( page: Page, diff --git a/playwright/utils/storage.ts b/playwright/utils/storage.ts index b22d09d844..1f88559772 100644 --- a/playwright/utils/storage.ts +++ b/playwright/utils/storage.ts @@ -1,5 +1,5 @@ import type { Page } from '@playwright/test' -import { privateKeyPersistedState } from './test-inputs' +import { privateKeyPersistedState } from '../../src/utils/__fixtures__/test-inputs' export async function clearPersistedStorage(page: Page) { // Move to the right domain, but don't needlessly load HTML and JS. diff --git a/playwright/utils/test-inputs.ts b/src/utils/__fixtures__/test-inputs.ts similarity index 94% rename from playwright/utils/test-inputs.ts rename to src/utils/__fixtures__/test-inputs.ts index d90a240d03..eb4547699b 100644 --- a/playwright/utils/test-inputs.ts +++ b/src/utils/__fixtures__/test-inputs.ts @@ -1,7 +1,7 @@ -import type { ImportAccountsStep } from '../../src/app/state/importaccounts/types' -import type { TransactionFormSteps } from '../../src/app/state/paratimes/types' -import type { WalletType } from '../../src/app/state/wallet/types' -import type { RootState } from '../../src/types/RootState' +import type { ImportAccountsStep } from 'app/state/importaccounts/types' +import type { TransactionFormSteps } from 'app/state/paratimes/types' +import type { WalletType } from 'app/state/wallet/types' +import type { RootState } from 'types' export const mnemonicAddress0 = 'oasis1qqca0gplrfn63ljg9c833te7em36lkz0cv8djffh' export const mnemonicAddress0Pretty = 'oasis1 qqca 0gpl rfn6 3ljg 9c83 3te7 em36 lkz0 cv8d jffh' @@ -132,5 +132,4 @@ export const privateKeyUnlockedState = { }), enteredWrongPassword: false, }, - // TODO: this doesn't check types?! } satisfies RootState diff --git a/src/utils/webextension.test.ts b/src/utils/__tests__/webextension.test.ts similarity index 94% rename from src/utils/webextension.test.ts rename to src/utils/__tests__/webextension.test.ts index ea5e326725..e51e66b30c 100644 --- a/src/utils/webextension.test.ts +++ b/src/utils/__tests__/webextension.test.ts @@ -1,5 +1,5 @@ import browser from 'webextension-polyfill' -import { openLedgerAccessPopup } from './webextension' +import { openLedgerAccessPopup } from '../webextension' jest.mock('webextension-polyfill', () => ({ extension: {