Skip to content

Commit

Permalink
solution: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
BOOMER74 committed Nov 29, 2023
1 parent 7a3005d commit f3664f8
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 31 deletions.
8 changes: 5 additions & 3 deletions packages/react-app/jest.setup.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { TextDecoder, TextEncoder } from 'util';
import * as Enzyme from 'enzyme';
import * as Adapter from 'enzyme-adapter-react-16';
import Adapter from 'enzyme-adapter-react-16';
import 'jest-canvas-mock';

global.TextEncoder = TextEncoder;
global.TextDecoder = TextDecoder;
Object.defineProperties(globalThis, {
TextDecoder: { value: TextDecoder },
TextEncoder: { value: TextEncoder },
});

Enzyme.configure({ adapter: new Adapter() });
13 changes: 2 additions & 11 deletions packages/react-app/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,13 @@
"extends": "../../tsconfig.json",
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"esModuleInterop": false,
"jsx": "react",
"outDir": "lib/",
"resolveJsonModule": true,
"rootDir": "src/"
},
"exclude": [
"node_modules",
"**/*.spec.ts",
"**/*.spec.tsx"
],
"include": [
"src/**/*.ts",
"src/**/*.tsx",
"src/i18n/locales/**/*.json"
],
"exclude": ["node_modules", "**/*.spec.ts", "**/*.spec.tsx"],
"include": ["src/**/*.ts", "src/**/*.tsx", "src/i18n/locales/**/*.json"],
"references": [
{
"path": "../core"
Expand Down
9 changes: 7 additions & 2 deletions packages/store/src/txstash/handler/handler.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import { WalletEntry, isBitcoinEntry } from '@emeraldpay/emerald-vault-core';
import { EthereumRawTransaction, decodeData, isEthereumRawTransaction, workflow } from '@emeraldwallet/core';
import { TxAction } from '../types';
import { prepareEthereumTransaction, restoreBitcoinTransaction, restoreEthereumTransaction } from './blockchain';
import {
prepareBitcoinTransaction,
prepareEthereumTransaction,
restoreBitcoinTransaction,
restoreEthereumTransaction,
} from './blockchain';
import { Data, Handler, StoreProvider } from './types';

function ethereumTxTypeSelector<T>(rawTx: EthereumRawTransaction, whenEther: T, whenContract: T): T {
Expand Down Expand Up @@ -36,7 +41,7 @@ export function getHandler(data: Data<WalletEntry>, storeProvider: StoreProvider
storeProvider,
);
case TxAction.TRANSFER:
return restoreBitcoinTransaction(
return prepareBitcoinTransaction(
{ ...data, entry },
{
getTxMetaType() {
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/jest.setup.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as Enzyme from 'enzyme';
import * as Adapter from 'enzyme-adapter-react-16';
import Adapter from 'enzyme-adapter-react-16';
import 'jest-canvas-mock';

Enzyme.configure({ adapter: new Adapter() });
17 changes: 3 additions & 14 deletions packages/ui/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,14 @@
"extends": "../../tsconfig.json",
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"esModuleInterop": false,
"jsx": "react",
"outDir": "lib/",
"rootDir": "src/",
"strict": false,
"typeRoots": [
"../../node_modules/@types",
"node_modules/@types"
]
"typeRoots": ["../../node_modules/@types", "node_modules/@types"]
},
"exclude": [
"node_modules",
"**/*.spec.ts",
"**/*.spec.tsx"
],
"include": [
"src/**/*.ts",
"src/**/*.tsx"
],
"exclude": ["node_modules", "**/*.spec.ts", "**/*.spec.tsx"],
"include": ["src/**/*.ts", "src/**/*.tsx"],
"references": [
{
"path": "../core"
Expand Down

0 comments on commit f3664f8

Please sign in to comment.