Skip to content

Commit 0b584cd

Browse files
authored
Merge pull request #5201 from EdgeApp/jon/smol-4.12
Jon/smol-4.12
2 parents 09e5128 + 80abe8e commit 0b584cd

21 files changed

+935
-315
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## Unreleased
44

5+
- added: `CryptoIcon` logo support to displayed request QR codes
6+
- added: Initial implementation of `SceneHeaderUi4`
57
- added: App distribution via Zealot
68
- added: Add disableSurveyModal option
79
- added: dRPC api key option for EVM chains
@@ -10,6 +12,12 @@
1012
- changed: Disable Home scene swap and FIO cards if configured
1113
- changed: Allow some chains to be disabled in env.json
1214
- changed: Add more metadata to zealot upload
15+
- changed: Token swap error demoted to red error dropdown to a toast
16+
- changed: 1 cent minimum requirement for high fee warning
17+
- fixed: Cutoff UI in `CreateWalletImportScene` when keyboard open
18+
- fixed: Unecessary eye icon in `CreateWalletImportScene` text input field
19+
- fixed: PoweredBy card displaying custom system fonts
20+
- fixed: Inconsistent button UI in `SwapSuccessScene`
1321
- fixed: Keyboard remaining visible when opening the side menu
1422
- fixed: Do not spin forever if the spam filter eliminates too many transactions.
1523
- fixed: FIO OBT data not showing in received transaction memos
Lines changed: 61 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,72 @@
11
import { describe, expect, it } from '@jest/globals'
2+
import { EdgeCurrencyInfo } from 'edge-core-js'
23
import * as React from 'react'
3-
import { createRenderer } from 'react-test-renderer/shallow'
4+
import TestRenderer from 'react-test-renderer'
45

5-
import { SwapSuccessSceneComponent } from '../../components/scenes/SwapSuccessScene'
6-
import { getTheme } from '../../components/services/ThemeContext'
6+
import { SwapSuccessScene } from '../../components/scenes/SwapSuccessScene'
7+
import { FakeProviders, FakeState } from '../../util/fake/FakeProviders'
78
import { fakeSceneProps } from '../../util/fake/fakeSceneProps'
89

10+
const currencyInfo: EdgeCurrencyInfo = {
11+
pluginId: 'bitcoin',
12+
currencyCode: 'BTC',
13+
displayName: 'Bitcoin',
14+
walletType: 'bitcoin',
15+
16+
addressExplorer: '',
17+
transactionExplorer: '',
18+
19+
defaultSettings: {},
20+
metaTokens: [],
21+
denominations: [
22+
{
23+
name: 'BTC',
24+
multiplier: '100000000',
25+
symbol: '₿'
26+
}
27+
]
28+
}
29+
30+
const fakeCurrencyConfig: any = {
31+
currencyInfo,
32+
allTokens: {},
33+
builtinTokens: {},
34+
customTokens: {}
35+
}
36+
37+
const fakeCoreWallet: any = {
38+
balanceMap: new Map([[null, '123123']]),
39+
blockHeight: 12345,
40+
currencyConfig: fakeCurrencyConfig,
41+
currencyInfo,
42+
enabledTokenIds: [],
43+
fiatCurrencyCode: 'iso:USD',
44+
id: '123',
45+
name: 'wallet name',
46+
type: 'wallet:bitcoin',
47+
watch() {}
48+
}
49+
950
describe('SwapSuccessSceneComponent', () => {
1051
it('should render with loading props', () => {
11-
const renderer = createRenderer()
12-
13-
const fakeDisklet: any = {}
52+
const fakeState: FakeState = {
53+
core: {
54+
account: {
55+
id: '',
56+
currencyWallets: { '123': fakeCoreWallet },
57+
currencyConfig: { bitcoin: fakeCurrencyConfig },
58+
watch() {}
59+
}
60+
}
61+
}
1462

15-
const actual = renderer.render(<SwapSuccessSceneComponent {...fakeSceneProps('swapSuccess', {})} userId="" disklet={fakeDisklet} theme={getTheme()} />)
63+
const renderer = TestRenderer.create(
64+
<FakeProviders initialState={fakeState}>
65+
<SwapSuccessScene {...fakeSceneProps('swapSuccess', {})} />
66+
</FakeProviders>
67+
)
1668

17-
expect(actual).toMatchSnapshot()
69+
expect(renderer.toJSON()).toMatchSnapshot()
70+
renderer.unmount()
1871
})
1972
})

src/__tests__/scenes/__snapshots__/CreateWalletImportScene.test.tsx.snap

Lines changed: 82 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ exports[`CreateWalletImportScene should render with loading props 1`] = `
1919
"paddingRight": 0,
2020
"paddingTop": 64,
2121
},
22-
{
23-
"maxHeight": 1334,
24-
},
2522
{
2623
"padding": 0,
2724
},
@@ -236,80 +233,100 @@ exports[`CreateWalletImportScene should render with loading props 1`] = `
236233
</BVLinearGradient>
237234
<View
238235
style={
239-
[
240-
{
241-
"justifyContent": "center",
242-
"marginHorizontal": 22,
243-
"paddingBottom": 22,
244-
},
245-
{
246-
"marginTop": 22,
247-
},
248-
undefined,
249-
]
236+
{
237+
"flexShrink": 1,
238+
"margin": 11,
239+
}
250240
}
251241
>
252242
<View
253243
style={
254244
{
255-
"alignItems": "center",
256-
"flexDirection": "row",
257-
"justifyContent": "space-between",
245+
"justifyContent": "center",
246+
"marginHorizontal": 11,
247+
"overflow": "visible",
248+
"paddingBottom": 22,
258249
}
259250
}
260251
>
261-
<Text
262-
adjustsFontSizeToFit={true}
263-
minimumFontScale={0.65}
264-
numberOfLines={1}
252+
<View
265253
style={
254+
{
255+
"alignItems": "center",
256+
"flexDirection": "row",
257+
"justifyContent": "space-between",
258+
}
259+
}
260+
>
261+
<Text
262+
adjustsFontSizeToFit={true}
263+
minimumFontScale={0.65}
264+
numberOfLines={1}
265+
style={
266+
[
267+
{
268+
"color": "#FFFFFF",
269+
"fontFamily": "Quicksand-Regular",
270+
"fontSize": 22,
271+
"includeFontPadding": false,
272+
},
273+
{
274+
"fontFamily": "Quicksand-Medium",
275+
"fontSize": 27,
276+
},
277+
null,
278+
]
279+
}
280+
>
281+
Import Wallet
282+
</Text>
283+
</View>
284+
<BVLinearGradient
285+
colors={
266286
[
267-
{
268-
"color": "#FFFFFF",
269-
"fontFamily": "Quicksand-Regular",
270-
"fontSize": 22,
271-
"includeFontPadding": false,
272-
},
273-
{
274-
"fontFamily": "Quicksand-Medium",
275-
"fontSize": 27,
276-
},
277-
null,
287+
452984831,
288+
452984831,
278289
]
279290
}
280-
>
281-
Import Wallet
282-
</Text>
291+
endPoint={
292+
{
293+
"x": 1,
294+
"y": 0.5,
295+
}
296+
}
297+
locations={null}
298+
startPoint={
299+
{
300+
"x": 0,
301+
"y": 0.5,
302+
}
303+
}
304+
style={
305+
{
306+
"alignSelf": "stretch",
307+
"height": 1,
308+
"marginRight": -22,
309+
"marginTop": 22,
310+
}
311+
}
312+
/>
283313
</View>
284-
</View>
285-
<View
286-
style={
287-
{
288-
"flexDirection": "row",
289-
"justifyContent": "center",
290-
"marginVertical": 45,
291-
}
292-
}
293-
>
294-
<ImportKeySvg
295-
accessibilityHint="Import Key"
296-
color="#00f1a2"
297-
height={36}
298-
width={83}
299-
/>
300-
</View>
301-
<View
302-
style={
303-
[
304-
{
305-
"margin": 11,
306-
},
314+
<View
315+
style={
307316
{
308-
"flexGrow": 1,
309-
},
310-
]
311-
}
312-
>
317+
"flexDirection": "row",
318+
"justifyContent": "center",
319+
"marginVertical": 45,
320+
}
321+
}
322+
>
323+
<ImportKeySvg
324+
accessibilityHint="Import Key"
325+
color="#00f1a2"
326+
height={36}
327+
width={83}
328+
/>
329+
</View>
313330
<Text
314331
adjustsFontSizeToFit={false}
315332
numberOfLines={0}
@@ -548,11 +565,12 @@ exports[`CreateWalletImportScene should render with loading props 1`] = `
548565
}
549566
keyboardType="email-address"
550567
multiline={true}
551-
numberOfLines={20}
568+
numberOfLines={10}
552569
onBlur={[Function]}
553570
onChangeText={[Function]}
554571
onFocus={[Function]}
555572
onSubmitEditing={[Function]}
573+
returnKeyType="none"
556574
scale={
557575
{
558576
"value": 1,

src/__tests__/scenes/__snapshots__/SwapConfirmationScene.test.tsx.snap

Lines changed: 48 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1402,21 +1402,45 @@ exports[`SwapConfirmationScene should render with loading props 1`] = `
14021402
}
14031403
>
14041404
<Text
1405+
adjustsFontSizeToFit={true}
1406+
minimumFontScale={0.65}
1407+
numberOfLines={1}
14051408
style={
1406-
{
1407-
"color": "#3dd9f4",
1408-
"fontSize": 17,
1409-
}
1409+
[
1410+
{
1411+
"color": "#FFFFFF",
1412+
"fontFamily": "Quicksand-Regular",
1413+
"fontSize": 22,
1414+
"includeFontPadding": false,
1415+
},
1416+
{
1417+
"color": "#3dd9f4",
1418+
"fontSize": 17,
1419+
},
1420+
null,
1421+
]
14101422
}
14111423
>
14121424
Powered by
14131425
</Text>
14141426
<Text
1427+
adjustsFontSizeToFit={true}
1428+
minimumFontScale={0.65}
1429+
numberOfLines={1}
14151430
style={
1416-
{
1417-
"color": "#3dd9f4",
1418-
"fontSize": 17,
1419-
}
1431+
[
1432+
{
1433+
"color": "#FFFFFF",
1434+
"fontFamily": "Quicksand-Regular",
1435+
"fontSize": 22,
1436+
"includeFontPadding": false,
1437+
},
1438+
{
1439+
"color": "#3dd9f4",
1440+
"fontSize": 17,
1441+
},
1442+
null,
1443+
]
14201444
}
14211445
/>
14221446
</View>
@@ -1428,11 +1452,23 @@ exports[`SwapConfirmationScene should render with loading props 1`] = `
14281452
}
14291453
>
14301454
<Text
1455+
adjustsFontSizeToFit={true}
1456+
minimumFontScale={0.65}
1457+
numberOfLines={1}
14311458
style={
1432-
{
1433-
"color": "#888888",
1434-
"fontSize": 17,
1435-
}
1459+
[
1460+
{
1461+
"color": "#FFFFFF",
1462+
"fontFamily": "Quicksand-Regular",
1463+
"fontSize": 22,
1464+
"includeFontPadding": false,
1465+
},
1466+
{
1467+
"color": "#888888",
1468+
"fontSize": 17,
1469+
},
1470+
null,
1471+
]
14361472
}
14371473
>
14381474
Tap to Change Provider

0 commit comments

Comments
 (0)