Skip to content

Commit a6a4604

Browse files
committed
test(connect): adjust unit test
1 parent 79ed267 commit a6a4604

File tree

2 files changed

+7
-36
lines changed

2 files changed

+7
-36
lines changed

packages/connect/src/backend/__tests__/Blockchain.test.ts

-27
Original file line numberDiff line numberDiff line change
@@ -67,31 +67,4 @@ describe('backend/Blockchain', () => {
6767

6868
spy.mockClear();
6969
});
70-
71-
it('cache estimated fees (ethereum-like) - L2 network', async () => {
72-
const coinInfo = getEthereumNetwork('BASE');
73-
if (!coinInfo) throw new Error('coinInfo is missing');
74-
75-
const spy = jest.spyOn(BlockchainLink.prototype, 'estimateFee');
76-
77-
const backend = await initBlockchain(coinInfo, () => {});
78-
79-
// blocks: 1 was not requested before
80-
await backend.estimateFee({ blocks: [1] });
81-
expect(spy.mock.calls.length).toEqual(1);
82-
83-
// blocks: 1 is requested again, returned from cache
84-
await backend.estimateFee({ blocks: [1] });
85-
expect(spy.mock.calls.length).toEqual(1);
86-
87-
// blocks: 2 was not requested before
88-
await backend.estimateFee({ blocks: [1, 2] });
89-
expect(spy.mock.calls.length).toEqual(2);
90-
91-
// request with "specific" field
92-
await backend.estimateFee({ blocks: [1, 2], specific: { value: '0x0' } });
93-
expect(spy.mock.calls.length).toEqual(3);
94-
95-
spy.mockClear();
96-
});
9770
});

packages/connect/src/utils/__tests__/deviceFeaturesUtils.test.ts

+7-9
Original file line numberDiff line numberDiff line change
@@ -129,15 +129,11 @@ describe('utils/deviceFeaturesUtils', () => {
129129
expect(getUnavailableCapabilities(featT1B1, coins2)).toEqual({
130130
ada: 'no-support',
131131
tada: 'no-support',
132-
bnb: 'no-support',
133-
bsc: 'update-required',
134-
arb: 'update-required',
135-
base: 'update-required',
132+
bnb: 'update-required',
136133
crw: 'update-required',
137134
eos: 'no-support',
138135
maid: 'no-capability',
139136
pol: 'update-required',
140-
op: 'update-required',
141137
omni: 'no-capability',
142138
ppc: 'update-required',
143139
sol: 'no-support',
@@ -150,6 +146,7 @@ describe('utils/deviceFeaturesUtils', () => {
150146
txrp: 'no-support',
151147
uno: 'update-required',
152148
usdt: 'no-capability',
149+
xec: 'update-required',
153150
xmr: 'no-support',
154151
xrp: 'no-support',
155152
xtz: 'no-support',
@@ -174,21 +171,19 @@ describe('utils/deviceFeaturesUtils', () => {
174171
expect(getUnavailableCapabilities(featT2T1, coins2)).toEqual({
175172
replaceTransaction: 'update-required',
176173
amountUnit: 'update-required',
177-
arb: 'update-required',
178-
base: 'update-required',
179-
bsc: 'update-required',
174+
bnb: 'update-required',
180175
decreaseOutput: 'update-required',
181176
eip1559: 'update-required',
182177
'eip712-domain-only': 'update-required',
183178
maid: 'no-capability',
184179
pol: 'update-required',
185-
op: 'update-required',
186180
omni: 'no-capability',
187181
taproot: 'update-required',
188182
tsep: 'update-required',
189183
thol: 'update-required',
190184
trvn: 'update-required',
191185
usdt: 'no-capability',
186+
xec: 'update-required',
192187
coinjoin: 'update-required',
193188
signMessageNoScriptType: 'update-required',
194189
sol: 'no-capability',
@@ -201,6 +196,8 @@ describe('utils/deviceFeaturesUtils', () => {
201196
it('default T2B1', () => {
202197
const coins2 = getAllNetworks();
203198

199+
console.log('coins2', coins2);
200+
204201
expect(getUnavailableCapabilities(featT2B1, coins2)).toEqual({
205202
breeze: 'no-support',
206203
btg: 'no-support',
@@ -224,6 +221,7 @@ describe('utils/deviceFeaturesUtils', () => {
224221
tsep: 'update-required',
225222
usdt: 'no-capability',
226223
vtc: 'no-support',
224+
xec: 'update-required',
227225
xem: 'no-support',
228226
chunkify: 'update-required',
229227
entropyCheck: 'update-required',

0 commit comments

Comments
 (0)