diff --git a/src/__tests__/store/electrumSlice.spec.ts b/src/__tests__/store/electrumSlice.spec.ts index 60d01119..f738a410 100644 --- a/src/__tests__/store/electrumSlice.spec.ts +++ b/src/__tests__/store/electrumSlice.spec.ts @@ -4,7 +4,10 @@ import reducer, { } from '../../store/features/electrumSlice'; test('should return the initial state', () => { - expect(reducer(undefined, {} as AnyAction)).toEqual([]); + expect(reducer(undefined, {} as AnyAction)).toEqual({ + txs: [], + connection: null, + }); }); test('should set the electrum list', () => { @@ -20,7 +23,7 @@ test('should set the electrum list', () => { }, }; - expect(reducer([], transactionsStatusChanged([mockTx]))).toStrictEqual([ - mockTx, - ]); + expect( + reducer({ connection: null, txs: [] }, transactionsStatusChanged([mockTx])) + ).toStrictEqual({ txs: [mockTx], connection: null }); }); diff --git a/src/__tests__/store/listSellersSlice.spec.ts b/src/__tests__/store/listSellersSlice.spec.ts index aa3c098c..fd1de765 100644 --- a/src/__tests__/store/listSellersSlice.spec.ts +++ b/src/__tests__/store/listSellersSlice.spec.ts @@ -1,9 +1,13 @@ +import { TextEncoder, TextDecoder } from 'util'; + import { AnyAction } from '@reduxjs/toolkit'; import reducer, { setRegistryProviders, } from '../../store/features/providersSlice'; import { ExtendedProviderStatus } from '../../models/apiModel'; +Object.assign(global, { TextDecoder, TextEncoder }); + const exampleTestnetProvider: ExtendedProviderStatus = { multiAddr: '/dnsaddr/t.xmr.example', peerId: '12394294389438924', @@ -58,9 +62,10 @@ describe('testnet', () => { initialState, setRegistryProviders([exampleMainnetProvider, exampleTestnetProvider]) ) - ).toContainEqual({ + ).toMatchObject({ registry: { providers: [exampleTestnetProvider], + failedReconnectAttemptsSinceLastSuccess: 0, }, selectedProvider: exampleTestnetProvider, }); @@ -78,9 +83,17 @@ describe('mainnet', () => { initialState, setRegistryProviders([exampleMainnetProvider, exampleTestnetProvider]) ) - ).toEqual({ + ).toMatchObject({ registry: { providers: [exampleMainnetProvider], + failedReconnectAttemptsSinceLastSuccess: 0, + }, + rendezvous: { + providers: [], + processRunning: false, + exitCode: null, + stdOut: '', + logs: [], }, selectedProvider: exampleMainnetProvider, }); diff --git a/src/renderer/components/pages/help/ElectrumInfoBox.tsx b/src/renderer/components/pages/help/ElectrumInfoBox.tsx index 8e0b10ee..be95dbee 100644 --- a/src/renderer/components/pages/help/ElectrumInfoBox.tsx +++ b/src/renderer/components/pages/help/ElectrumInfoBox.tsx @@ -1,5 +1,5 @@ -import InfoBox from '../../modal/swap/InfoBox'; import { Typography } from '@material-ui/core'; +import InfoBox from '../../modal/swap/InfoBox'; import BitcoinIcon from '../../icons/BitcoinIcon'; import { useAppSelector } from '../../../../store/hooks'; @@ -11,7 +11,7 @@ export default function ElectrumInfoBox() { return ( The GUI connects to a Bitcoin Electrum Server to retrieve Blockchain diff --git a/src/store/features/providersSlice.ts b/src/store/features/providersSlice.ts index 59bb1a7b..c8431944 100644 --- a/src/store/features/providersSlice.ts +++ b/src/store/features/providersSlice.ts @@ -155,7 +155,7 @@ export const providersSlice = createSlice({ slice.selectedProvider = selectNewSelectedProvider(slice); }, increaseFailedRegistryReconnectAttemptsSinceLastSuccess(slice) { - slice.registry.failedReconnectAttemptsSinceLastSuccess++; + slice.registry.failedReconnectAttemptsSinceLastSuccess += 1; }, setSelectedProvider( slice, diff --git a/src/utils/multiAddrUtils.ts b/src/utils/multiAddrUtils.ts index 376d6a19..96367dab 100644 --- a/src/utils/multiAddrUtils.ts +++ b/src/utils/multiAddrUtils.ts @@ -1,6 +1,6 @@ import { Multiaddr } from 'multiaddr'; -import { ExtendedProviderStatus, Provider } from '../models/apiModel'; import semver from 'semver'; +import { ExtendedProviderStatus, Provider } from '../models/apiModel'; import { isTestnet } from '../store/config'; const MIN_ASB_VERSION = '0.12.0';