Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
371 commits
Select commit Hold shift + click to select a range
34b53dc
Fix: SuccessErrorSheet Test Case Added
smgv May 30, 2025
e494c55
Merge branch 'feat/new-srp-backup' of https://github.com/MetaMask/met…
smgv May 30, 2025
a2cc81c
test: remove duplicate Optin login in e2e srp function
hieu-w May 30, 2025
4140c2d
Merge branch 'feat/new-create-import-srp' into feat/new-srp-backup
hieu-w May 30, 2025
436930d
Merge branch 'feat/new-srp-backup' into feat/new-srp-backup-step1
hieu-w May 30, 2025
43fdb90
test: move Optin back to first step in e2e srp function
hieu-w May 30, 2025
c3161cc
test: move Optin screen after tap ImportSRP
hieu-w May 30, 2025
1466a28
test: move Optin screen after tab import SRP
hieu-w May 30, 2025
4976568
Merge branch 'feat/new-srp-onboarding-success' into feat/new-srp-login
hieu-w May 30, 2025
a474211
fix: lint , lint:tsc
ieow May 30, 2025
0206e52
Fix: SuccessErrorSheet and ManualBackupStep2 Test Case Update
smgv May 30, 2025
7290f2e
Merge branch 'feat/new-srp-backup' of https://github.com/MetaMask/met…
smgv May 30, 2025
5479cb7
test: add delay after enter SRP
hieu-w May 30, 2025
237bb1b
Merge branch 'feat/new-create-import-srp' of https://github.com/MetaM…
hieu-w May 30, 2025
1fe5d90
test: add delay after enter SRP
hieu-w May 30, 2025
4867ac5
test: remove wrong e2e step
hieu-w May 30, 2025
d027f35
Merge branch 'main' into feat/new-create-import-srp
hieu-w May 30, 2025
70cc7c7
Merge branch 'main' into feat/srp-onboarding-carousel-tnc
hieu-w May 30, 2025
9be7048
Merge branch 'feat/srp-onboarding-carousel-tnc' into feat/new-srp-wel…
hieu-w May 30, 2025
404dddb
Merge branch 'feat/new-srp-welcome' into feat/new-create-import-srp
hieu-w May 30, 2025
7a00030
test: fix duplicate testId cause Issue on ios srp flow
hieu-w May 30, 2025
4eeb8bc
feat: New welcome screen (#15666)
ieow May 30, 2025
1b8b035
Fix :SucessErrorSheet Test Case
smgv May 30, 2025
de02cf6
Fix: Test Case Update
smgv May 30, 2025
dd1e797
Fix: Test Case Update
smgv May 30, 2025
de852ab
test: fix ios typing fast cause issue on srp flow
hieu-w May 30, 2025
7130526
Merge branch 'feat/srp-onboarding-carousel-tnc' into feat/new-create-…
hieu-w May 30, 2025
d5f061a
Merge branch 'feat/new-srp-backup' into feat/new-srp-backup-step1
hieu-w May 30, 2025
f3ca3c9
test: fix ios typing fast cause issue on srp flow
hieu-w May 30, 2025
1f9864e
test: add delay after accept. term of use
hieu-w May 30, 2025
b6e6ffa
Merge branch 'feat/new-create-import-srp' into feat/new-srp-backup
hieu-w May 30, 2025
80fba05
Merge branch 'feat/new-srp-backup' into feat/new-srp-backup-step1
hieu-w May 30, 2025
e90b041
Merge branch 'feat/new-srp-backup-step1' into feat/new-srp-onboarding…
hieu-w May 30, 2025
2c12f6c
Merge branch 'feat/new-srp-onboarding-success' into feat/new-srp-login
hieu-w May 30, 2025
b420ba2
fix: add delay to wait grid srp render and button enabled
ieow May 31, 2025
a754179
fix: add logging for debug
ieow May 31, 2025
ec951a9
fix: add more delay before tap continue
ieow May 31, 2025
490112b
Merge branch 'main' into feat/srp-onboarding-carousel-tnc
chaitanyapotti May 31, 2025
c44b2b8
fix: waitFor if enable
ieow May 31, 2025
9a06f42
test: fix keyboard overlay continue button
hieu-w May 31, 2025
8676994
test: fix keyboard overlay issue on SRP screen
hieu-w May 31, 2025
e608ba4
fix: add more threshold padding allowance for android in optin matric
ieow May 31, 2025
75a5d16
Merge branch 'feat/srp-onboarding-carousel-tnc' into feat/new-create-…
ieow May 31, 2025
70d291e
Fix: ManualBackupStep1 Test Case Update
smgv May 31, 2025
059ce9e
Merge branch 'feat/new-srp-backup' of https://github.com/MetaMask/met…
smgv May 31, 2025
333e3cb
feat: optin button sometime will always disabled even swipe to end
ieow May 31, 2025
2435685
Merge branch 'feat/new-create-import-srp' into feat/new-srp-backup
hieu-w May 31, 2025
4f9324b
fix: tests and coverage
ieow May 31, 2025
0bc58a3
fix: remove duplidcate testID
hieu-w May 31, 2025
d00280d
fix: update coverage
ieow May 31, 2025
c43114f
Fix: Test Case ManualBackupStep2 Update
smgv May 31, 2025
52909e7
Merge branch 'feat/new-srp-backup' of https://github.com/MetaMask/met…
smgv May 31, 2025
d37e264
Fix: Snapshot Updated
smgv May 31, 2025
e33afd6
fix: update snapshot
ieow May 31, 2025
6d4cb7b
Fix: SuccessErrorSheet Test Case Update
smgv May 31, 2025
693fb2a
Fix: Test Case Update ManualBackupStep2
smgv May 31, 2025
a2496d8
Merge branch 'feat/new-create-import-srp' into feat/new-srp-backup
hieu-w May 31, 2025
e99ca31
Fix: ManualbackupStep1 Test Case Update
smgv May 31, 2025
4feb711
Merge branch 'feat/new-srp-backup' of https://github.com/MetaMask/met…
smgv May 31, 2025
52d4d8c
test: add delay for Accept Button reaction
hieu-w May 31, 2025
64c15ed
Fix: Test Case Update to cover route params
smgv May 31, 2025
85895b0
Merge branch 'feat/new-srp-backup' of https://github.com/MetaMask/met…
smgv May 31, 2025
bad59ec
Fix: ManualBackupStep2 Test Case Update
smgv May 31, 2025
4c66510
Fix: BottomSheet Test Case
smgv May 31, 2025
a1a5b35
Fix: Test Case Update
smgv May 31, 2025
342a211
Fix: Resolving Quality Gate Issues
smgv May 31, 2025
1124789
Fix: Duplicate Prop
smgv May 31, 2025
efd1d78
fix: update optin metric ui
ieow Jun 1, 2025
0a27a49
fix: update snapshot
ieow Jun 1, 2025
7fb1fe5
Merge branch 'feat/new-srp-backup' into feat/new-srp-backup-step1
hieu-w Jun 1, 2025
10a6664
Fix: SkipAccountSecurityModal Test Case Update
smgv Jun 1, 2025
fa06007
Merge branch 'feat/new-srp-backup-step1' of https://github.com/MetaMa…
smgv Jun 1, 2025
6a4debf
Fix: SeedPhraseModal Test Case Update
smgv Jun 1, 2025
732d250
feat: add test for OnboardingSuccess View
hieu-w Jun 1, 2025
30041fb
Fix: AccountBackupStep1 Test Case Update
smgv Jun 1, 2025
643a1ed
feat: fix unitest OnboardingSuccess View
hieu-w Jun 1, 2025
a4c03a3
Fix: AccountBackupStep1 Test Case Update
smgv Jun 1, 2025
c564400
Fix: AccountBackupStep1 and AccountBackupStep1B Test Case Update
smgv Jun 1, 2025
c71f4a4
Fix: Navbar Test Case Update
smgv Jun 1, 2025
e7f330c
Fix: Test Case Update
smgv Jun 1, 2025
1ccd140
Fix: Test Case Update for SkipAccountSecurityModal
smgv Jun 1, 2025
4447fa7
feat: add unit test App render
hieu-w Jun 2, 2025
1e91716
Merge branch 'feat/new-create-import-srp' into feat/new-srp-backup
hieu-w Jun 2, 2025
0a711cb
Merge branch 'feat/new-srp-backup' into feat/new-srp-backup-step1
hieu-w Jun 2, 2025
035017c
Merge branch 'feat/new-srp-backup-step1' into feat/new-srp-onboarding…
hieu-w Jun 2, 2025
4dc978c
Merge branch 'feat/new-srp-onboarding-success' into feat/new-srp-login
hieu-w Jun 2, 2025
f902eb0
fix: minor refactor and add new test cases
ieow Jun 2, 2025
b00d2b2
Fix: SkipAccountSecurityModal Test Case Update
smgv Jun 2, 2025
4a3c18f
Merge branch 'feat/new-srp-backup-step1' of https://github.com/MetaMa…
smgv Jun 2, 2025
5117e99
Fix: Test Case Update AccountBackupStep1
smgv Jun 2, 2025
e98256f
feat: update biometric Icons
ieow Jun 2, 2025
87c069a
Fix: AccountBackupStep1B Test Case
smgv Jun 2, 2025
7e7a7b7
test: e2e add delay after scroll to finish transition
hieu-w Jun 2, 2025
7b5f1ca
Fix: Test Case Update
smgv Jun 2, 2025
ce70915
Fix: AccountBackupStep1B Navbar Update
smgv Jun 2, 2025
0d25da2
Merge branch 'feat/new-srp-backup' into feat/new-srp-backup-step1
hieu-w Jun 2, 2025
298da73
Fix: AccountBackupStep1 Test Case Updated
smgv Jun 2, 2025
e6e4f81
Merge branch 'feat/new-srp-backup-step1' of https://github.com/MetaMa…
smgv Jun 2, 2025
e4acfe6
Fix: Issues Resolved
smgv Jun 2, 2025
b675bc1
Fix: ManuaBackupStep2 missing word selection test case
smgv Jun 2, 2025
20fe7d9
Merge branch 'feat/new-srp-backup-step1' into feat/new-srp-onboarding…
hieu-w Jun 2, 2025
9e386df
test: bring back metric metricsOption step in SRP funciton
hieu-w Jun 2, 2025
7f7b439
performance optimizations
chaitanyapotti Jun 2, 2025
4feda72
Merge branch 'feat/new-srp-onboarding-success' into feat/new-srp-login
hieu-w Jun 2, 2025
ebef98a
Fix: ForgotPassword Flow Update and Test Case Update
smgv Jun 2, 2025
9695f5d
Merge branch 'feat/new-srp-login' of https://github.com/MetaMask/meta…
smgv Jun 2, 2025
b84dd92
fix: tests - error message logic update
ieow Jun 2, 2025
a213afd
Fix: Snapshot updated
smgv Jun 2, 2025
86075b5
chore: add test case on handle new input
ieow Jun 2, 2025
f766999
fix: skip account security modal action
ieow Jun 2, 2025
ddbe7d5
style fixes + optimizations
chaitanyapotti Jun 2, 2025
6a6537f
feat: delayed optin
ieow Jun 2, 2025
cec5712
Fix: Test Case Update and Lint issue Update
smgv Jun 2, 2025
6152765
Fix: removed unused variable
smgv Jun 2, 2025
20d2715
Merge branch 'main' into feat/new-create-import-srp
ieow Jun 3, 2025
b769d39
Fix: Translation Update
smgv Jun 3, 2025
75d862e
Merge branch 'feat/new-create-import-srp' into feat/new-srp-backup
ieow Jun 3, 2025
8ce3314
Merge branch 'main' into feat/new-create-import-srp
hieu-w Jun 3, 2025
d5eb243
feat: update test snapshot
hieu-w Jun 3, 2025
fbe4599
fix: tests
ieow Jun 3, 2025
67f9b01
Merge branch 'feat/new-srp-login' into feat/update-biometric-icon
ieow Jun 3, 2025
b13528a
Merge branch 'feat/new-create-import-srp' into feat/new-srp-backup
ieow Jun 3, 2025
54d5f5b
Merge branch 'feat/new-srp-backup' into feat/new-srp-backup-step1
ieow Jun 3, 2025
93a243f
fix issues
chaitanyapotti Jun 3, 2025
44375ea
fix: replace toSorted with sort
ieow Jun 3, 2025
5b4988f
fix comments
chaitanyapotti Jun 3, 2025
607297f
feat: update biometric Icons
ieow Jun 2, 2025
4f9c3c3
feat: update biometric Icons (#15963)
chaitanyapotti Jun 3, 2025
82bffe2
Merge branch 'feat/new-srp-onboarding-success' into feat/new-srp-login
hieu-w Jun 3, 2025
3a1d01f
Merge branch 'feat/new-srp-backup' into feat/new-srp-backup-step1
ieow Jun 3, 2025
70ba71b
Merge branch 'feat/new-srp-backup-step1' into feat/new-srp-login
ieow Jun 3, 2025
bb7aed1
Merge branch 'feat/new-srp-backup-step1' into feat/new-srp-onboarding…
ieow Jun 3, 2025
e8f6b6e
Merge branch 'feat/new-srp-onboarding-success' into feat/new-srp-login
ieow Jun 3, 2025
1488067
feat: remove unnecessary test
hieu-w Jun 3, 2025
434b184
feat: remove unuse snapshot
hieu-w Jun 3, 2025
58a3899
chore: convert OnboardingSuccessComponent to typescript
hieu-w Jun 3, 2025
1796313
Fix: Comment Review
smgv Jun 3, 2025
76f9a09
Fix: unused code removed
smgv Jun 3, 2025
3e1728e
test: update e2e for delaying MetricOptin
hieu-w Jun 3, 2025
e7f0afc
Merge branch 'main' into feat/new-create-import-srp
tommasini Jun 3, 2025
28f173b
Merge branch 'feat/new-srp-login' into feat/delayed-optin
hieu-w Jun 4, 2025
77d9fee
Merge branch 'feat/new-srp-onboarding-success' into feat/new-srp-login
hieu-w Jun 4, 2025
48ac1b4
fix: fix lint
hieu-w Jun 4, 2025
8cf6222
Fix: Comment Review Icon
smgv Jun 4, 2025
2e39fda
Merge branch 'feat/new-create-import-srp' of https://github.com/MetaM…
smgv Jun 4, 2025
2c2f384
Merge branch 'feat/new-srp-login' into feat/delayed-optin
hieu-w Jun 4, 2025
48d1bad
Fix: removed unused imports
smgv Jun 4, 2025
a85c7be
Fix: SkipAccountSecurityModal Test Case Update
smgv Jun 4, 2025
8d72531
fix: bring back render test and snapshot
hieu-w Jun 4, 2025
0e69090
fix: Update test name
hieu-w Jun 4, 2025
b4048fe
fix: update test name
hieu-w Jun 4, 2025
0ec1889
Fix: Comment Review - Removed Unused Import and Variables, Test Case …
smgv Jun 4, 2025
99cb3ab
Merge branch 'main' into feat/new-create-import-srp
hieu-w Jun 4, 2025
9b642be
Fix: test case update
smgv Jun 4, 2025
7c4aa8e
Fix: Test Case Update
smgv Jun 4, 2025
b291b5d
Merge branch 'feat/new-create-import-srp' into feat/new-srp-backup
smgv Jun 4, 2025
cefd183
Fix: SuccessErrorSheet Update
smgv Jun 4, 2025
d974e9c
Merge branch 'feat/new-srp-backup' of https://github.com/MetaMask/met…
smgv Jun 4, 2025
2afecbc
Fix: Icon and Test Case Update
smgv Jun 4, 2025
b191458
Fix: removed unused styles
smgv Jun 4, 2025
1ad0088
Fix: removed unused import
smgv Jun 4, 2025
07178da
Merge branch 'feat/new-srp-backup' into feat/new-srp-backup-step1
smgv Jun 4, 2025
86a822e
Fix: Icon update
smgv Jun 4, 2025
1d4cc18
Fix: SkipAccountSecurityModal Test Case Update
smgv Jun 4, 2025
a8f8e52
Merge branch 'main' into feat/new-srp-backup
ieow Jun 5, 2025
604eeaf
Fix: Icon update
smgv Jun 5, 2025
f224f69
Fix: removed unused Icons
smgv Jun 5, 2025
0d5a73a
Merge branch 'main' into feat/new-srp-backup
chaitanyapotti Jun 5, 2025
aa2f5a6
Merge branch 'feat/new-srp-backup' into feat/new-srp-backup-step1
ieow Jun 5, 2025
e7d7e75
Merge branch 'feat/new-srp-backup' into feat/delayed-optin
ieow Jun 6, 2025
e2021fe
Merge branch 'feat/new-srp-backup-step1' into feat/delayed-optin
ieow Jun 6, 2025
bb4acfb
fix: unit tests
ieow Jun 6, 2025
781ce3f
fix: useMetric and test
ieow Jun 6, 2025
f9b900e
Merge branch 'feat/new-srp-backup-step1' into feat/new-srp-onboarding…
ieow Jun 6, 2025
c13354a
Merge branch 'feat/new-srp-onboarding-success' into feat/new-srp-login
ieow Jun 6, 2025
6c4e639
Merge branch 'feat/new-srp-login' into feat/delayed-optin
ieow Jun 6, 2025
ac2275f
fix: update snapshot
ieow Jun 6, 2025
3347841
Fix: Test case update
smgv Jun 6, 2025
ab840b0
Fix: Test Case for ManualBackupStep2
smgv Jun 10, 2025
e08ec79
fix: update unit tests
ieow Jun 10, 2025
44e0b88
Merge branch 'main' into feat/new-srp-login
ieow Jun 12, 2025
304298e
fix: lint
ieow Jun 12, 2025
2aee451
Fix: test case update onboarding success
smgv Jun 12, 2025
1979720
Merge branch 'feat/new-srp-login' of https://github.com/MetaMask/meta…
smgv Jun 12, 2025
330d483
fix: update snapshot
ieow Jun 12, 2025
2c8f828
fix: nav test case update
smgv Jun 12, 2025
512a134
Merge branch 'feat/new-srp-login' of https://github.com/MetaMask/meta…
smgv Jun 12, 2025
ac727bb
fix: remove not needed delay
ieow Jun 12, 2025
22550fd
Merge branch 'feat/new-srp-login' into feat/delayed-optin
ieow Jun 12, 2025
c10793c
Fix: Test Case Update
smgv Jun 12, 2025
7ab9a22
Merge branch 'main' into feat/new-srp-login
chaitanyapotti Jun 12, 2025
23d1593
Fix: test case update
smgv Jun 12, 2025
eb7584d
Merge branch 'main' into feat/new-srp-login
hieu-w Jun 12, 2025
0871e90
Fix: test case update
smgv Jun 12, 2025
e9a0289
Fix: test case update
smgv Jun 12, 2025
0cfc1b5
fix: ManualBackupStep1 Test case update
smgv Jun 12, 2025
6ea4031
Fix: test case update
smgv Jun 12, 2025
affb78c
Merge branch 'main' into feat/new-srp-login
chaitanyapotti Jun 12, 2025
86513b3
Merge branch 'feat/new-srp-login' into feat/delayed-optin
ieow Jun 12, 2025
fe873a8
fix: Test case update
smgv Jun 12, 2025
dbe5f7c
Merge branch 'feat/delayed-optin' of https://github.com/MetaMask/meta…
smgv Jun 12, 2025
3667bdf
Merge branch 'main' into feat/new-srp-login
cortisiko Jun 12, 2025
4925898
Merge branch 'feat/new-srp-login' into feat/delayed-optin
ieow Jun 13, 2025
e3cdb9c
Merge branch 'main' into feat/new-srp-login
smgv Jun 13, 2025
26ddf13
fix: remove unuse step
hieu-w Jun 13, 2025
e1f535c
Merge branch 'feat/new-srp-login' into feat/delayed-optin
hieu-w Jun 13, 2025
6269610
feat: coverages test
ieow Jun 13, 2025
13b574b
fix: test coverage
ieow Jun 13, 2025
853aaa6
Merge branch 'main' into feat/new-srp-login
smgv Jun 13, 2025
21f4c4e
Merge branch 'main' into feat/new-srp-login
cortisiko Jun 13, 2025
2d6dd37
fix: mock runtAfterInteraction
ieow Jun 14, 2025
b2977d4
Merge branch 'feat/new-srp-login' into feat/delayed-optin
ieow Jun 14, 2025
fafd14c
fix: remove wrong test
ieow Jun 14, 2025
4432ce5
fix: test coverage
ieow Jun 14, 2025
219a90e
fix: lint
ieow Jun 14, 2025
2325763
fix: navigation typo
ieow Jun 14, 2025
0d435e8
fix: test
ieow Jun 14, 2025
8230428
fix: lint
ieow Jun 14, 2025
c7eecdf
fix: e2e tests
ieow Jun 14, 2025
2bb4d4b
Merge branch 'main' into feat/delayed-optin
chaitanyapotti Jun 15, 2025
5bfd14c
Merge branch 'main' into feat/delayed-optin
ieow Jun 16, 2025
4e18695
test: remove delay in e2e onboarding
hieu-w Jun 16, 2025
9ea24d4
Merge branch 'feat/delayed-optin' of https://github.com/MetaMask/meta…
hieu-w Jun 16, 2025
d13c353
test: add util to wait for element visible wo assert
hieu-w Jun 16, 2025
0f3b8a7
test: update import/create wallet e2e flow
hieu-w Jun 16, 2025
c4823b4
Revert "test: update import/create wallet e2e flow"
hieu-w Jun 16, 2025
c49ceb7
Revert "test: add util to wait for element visible wo assert"
hieu-w Jun 16, 2025
87fd5e2
test: fix onboarding optin tests
hieu-w Jun 16, 2025
3d74d9b
fix: update test snapshot after update testid
hieu-w Jun 16, 2025
52d84f9
feat: new srp sentry
ieow Jun 16, 2025
1229108
fix: lint:tsc
ieow Jun 16, 2025
01bc625
fix: lint:tsc
ieow Jun 16, 2025
c700ed7
fix: merge issue
ieow Jun 16, 2025
c2e14cb
feat: increase coverage
ieow Jun 16, 2025
444a850
feat: add Sentry traces for password reset operations
huggingbot Jun 17, 2025
504f594
chore: increase coverage
ieow Jun 17, 2025
38fcc41
fix: merge fix
ieow Jun 17, 2025
fe29129
fix: push coverage
ieow Jun 17, 2025
0cf4599
Merge branch 'main' into feat/new-srp-sentry
ieow Jun 17, 2025
0a461e2
fix: lint:tsc
ieow Jun 17, 2025
eeb512e
Merge branch 'main' into feat/new-srp-sentry
chaitanyapotti Jun 17, 2025
08e5548
fix: lottie flickering
ieow Jun 17, 2025
5f4240c
Merge branch 'main' into feat/new-srp-sentry
ieow Jun 17, 2025
07018ab
fix: merge issue
ieow Jun 17, 2025
3b89fed
chore: push coverage
ieow Jun 18, 2025
44e97b8
fix: lint
ieow Jun 18, 2025
9d933d8
fix: tests, push coverage
ieow Jun 18, 2025
768e771
chore: push coverage
ieow Jun 18, 2025
6093511
Merge branch 'main' into feat/new-srp-sentry
ieow Jun 18, 2025
40f9690
Merge branch 'main' into feat/new-srp-sentry
ieow Jun 19, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions app/components/UI/OptinMetrics/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ import Icon, {
IconColor,
} from '../../../component-library/components/Icons/Icon';
import { getConfiguredCaipChainIds } from '../../../util/metrics/MultichainAPI/networkMetricUtils';
import { setupSentry } from '../../../util/sentry/utils';
import {
flushBufferedTraces,
discardBufferedTraces,
} from '../../../util/trace';

const createStyles = ({ colors }) =>
StyleSheet.create({
Expand Down Expand Up @@ -324,6 +329,8 @@ class OptinMetrics extends PureComponent {
// and disable analytics
clearOnboardingEvents();
await metrics.enable(false);
await setupSentry(); // Re-setup Sentry with enabled: false
discardBufferedTraces();
}, 200);
this.continue();
};
Expand All @@ -340,6 +347,8 @@ class OptinMetrics extends PureComponent {
} = this.props;

await metrics.enable();
await setupSentry(); // Re-setup Sentry with enabled: true
await flushBufferedTraces();

// Handle null case for marketing consent
if (
Expand Down
9 changes: 9 additions & 0 deletions app/components/UI/OptinMetrics/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { MetaMetrics, MetaMetricsEvents } from '../../../core/Analytics';
import { fireEvent, screen, waitFor } from '@testing-library/react-native';
import { strings } from '../../../../locales/i18n';
import { MetricsEventBuilder } from '../../../core/Analytics/MetricsEventBuilder';
import storageWrapper from '../../../store/storage-wrapper';

const { InteractionManager } = jest.requireActual('react-native');

Expand Down Expand Up @@ -62,6 +63,7 @@ describe('OptinMetrics', () => {
name: strings('privacy_policy.cta_i_agree'),
}),
);

await waitFor(() => {
expect(mockMetrics.trackEvent).toHaveBeenNthCalledWith(
1,
Expand All @@ -85,6 +87,9 @@ describe('OptinMetrics', () => {
});

it('with marketing consent', async () => {
// mock StorageWrapper getItem to return 'agreed' for marketing consent
jest.spyOn(storageWrapper, 'getItem').mockResolvedValue('agreed');

renderScreen(OptinMetrics, { name: 'OptinMetrics' }, { state: {} });
fireEvent.press(screen.getByText(strings('privacy_policy.checkbox')));
fireEvent.press(
Expand Down Expand Up @@ -116,12 +121,16 @@ describe('OptinMetrics', () => {
});

it('does not call metrics on cancel', async () => {
jest.useFakeTimers();
renderScreen(OptinMetrics, { name: 'OptinMetrics' }, { state: {} });
fireEvent.press(
screen.getByRole('button', {
name: strings('privacy_policy.cta_no_thanks'),
}),
);

jest.advanceTimersByTime(1000);

await waitFor(() => {
expect(mockMetrics.trackEvent).not.toHaveBeenCalled();
expect(mockMetrics.addTraitsToUser).not.toHaveBeenCalled();
Expand Down
9 changes: 8 additions & 1 deletion app/components/Views/AccountBackupStep1/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ import { saveOnboardingEvent } from '../../../actions/onboarding';
import { CommonActions, useNavigation } from '@react-navigation/native';
import { useMetrics } from '../../hooks/useMetrics';
import { ONBOARDING_SUCCESS_FLOW } from '../../../constants/onboarding';
import { TraceName, bufferedEndTrace } from '../../../util/trace';

const createStyles = (colors) =>
StyleSheet.create({
Expand Down Expand Up @@ -114,6 +115,7 @@ const AccountBackupStep1 = (props) => {
const [hasFunds, setHasFunds] = useState(false);
const { colors } = useTheme();
const styles = createStyles(colors);
const { isEnabled: isMetricsEnabled } = useMetrics();

const track = (event, properties) => {
const eventBuilder = MetricsEventBuilder.createEventBuilder(event);
Expand Down Expand Up @@ -175,13 +177,18 @@ const AccountBackupStep1 = (props) => {
track(MetaMetricsEvents.WALLET_SECURITY_STARTED);
};

const { isEnabled: isMetricsEnabled } = useMetrics();
const skip = async () => {
track(MetaMetricsEvents.WALLET_SECURITY_SKIP_CONFIRMED);
// Get onboarding wizard state
const onboardingWizard = await StorageWrapper.getItem(ONBOARDING_WIZARD);
!onboardingWizard && props.setOnboardingWizardStep(1);

bufferedEndTrace({
name: TraceName.OnboardingNewSrpCreateWallet,
data: { skipBackup: true },
});
bufferedEndTrace({ name: TraceName.OnboardingJourneyOverall });

const resetAction = CommonActions.reset({
index: 1,
routes: [
Expand Down
32 changes: 32 additions & 0 deletions app/components/Views/ChoosePassword/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@ import { TextFieldSize } from '../../../component-library/components/Form/TextFi
import fox from '../../../animations/Searching_Fox.json';
import LottieView from 'lottie-react-native';
import { saveOnboardingEvent } from '../../../actions/onboarding';
import {
TraceName,
bufferedEndTrace,
bufferedTrace,
TraceOperation,
} from '../../../util/trace';

const createStyles = (colors) =>
StyleSheet.create({
Expand Down Expand Up @@ -236,6 +242,7 @@ class ChoosePassword extends PureComponent {
};

mounted = true;
passwordSetupAttemptTraceCtx = null;

confirmPasswordInput = React.createRef();
// Flag to know if password in keyring was set or not
Expand Down Expand Up @@ -291,6 +298,16 @@ class ChoosePassword extends PureComponent {
};

async componentDidMount() {
const { route } = this.props;
const onboardingTraceCtx = route.params?.onboardingTraceCtx;
if (onboardingTraceCtx) {
this.passwordSetupAttemptTraceCtx = bufferedTrace({
name: TraceName.OnboardingPasswordSetupAttempt,
op: TraceOperation.OnboardingUserJourney,
parentContext: onboardingTraceCtx,
});
}

const authData = await Authentication.getType();
const previouslyDisabled = await StorageWrapper.getItem(
BIOMETRY_CHOICE_DISABLED,
Expand Down Expand Up @@ -335,6 +352,10 @@ class ChoosePassword extends PureComponent {

componentWillUnmount() {
this.mounted = false;
if (this.passwordSetupAttemptTraceCtx) {
bufferedEndTrace({ name: TraceName.OnboardingPasswordSetupAttempt });
this.passwordSetupAttemptTraceCtx = null;
}
}

setSelection = () => {
Expand Down Expand Up @@ -421,6 +442,17 @@ class ChoosePassword extends PureComponent {
wallet_setup_type: 'new',
error_type: error.toString(),
});

const onboardingTraceCtx = this.props.route.params?.onboardingTraceCtx;
if (onboardingTraceCtx) {
bufferedTrace({
name: TraceName.OnboardingPasswordSetupError,
op: TraceOperation.OnboardingUserJourney,
parentContext: onboardingTraceCtx,
tags: { errorMessage: error.toString() },
});
bufferedEndTrace({ name: TraceName.OnboardingPasswordSetupError });
}
}
};

Expand Down
48 changes: 42 additions & 6 deletions app/components/Views/ImportFromSecretRecoveryPhrase/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ import { TextFieldSize } from '../../../component-library/components/Form/TextFi
import { wordlist } from '@metamask/scure-bip39/dist/wordlists/english';
import { LoginOptionsSwitch } from '../../UI/LoginOptionsSwitch';
import { saveOnboardingEvent } from '../../../actions/onboarding';
import { CommonActions } from '@react-navigation/native';
import { CommonActions, useRoute } from '@react-navigation/native';
import {
SRP_LENGTHS,
NUM_COLUMNS,
Expand All @@ -97,6 +97,12 @@ import { useMetrics } from '../../hooks/useMetrics';
import { ONBOARDING_SUCCESS_FLOW } from '../../../constants/onboarding';
import { useAccountsWithNetworkActivitySync } from '../../hooks/useAccountsWithNetworkActivitySync';
import { formatSeedPhraseToSingleLine } from '../../../util/string';
import {
TraceName,
bufferedEndTrace,
bufferedTrace,
TraceOperation,
} from '../../../util/trace';

const checkValidSeedWord = (text) => wordlist.includes(text);

Expand All @@ -111,14 +117,15 @@ const ImportFromSecretRecoveryPhrase = ({
setLockTime,
seedphraseBackedUp,
setOnboardingWizardStep,
route,
dispatchSaveOnboardingEvent,
}) => {
const route = useRoute();
const { colors, themeAppearance } = useTheme();
const styles = createStyles(colors);

const seedPhraseInputRefs = useRef([]);
const confirmPasswordInput = useRef();
const passwordSetupAttemptTraceCtxRef = useRef(null);

const { toastRef } = useContext(ToastContext);

Expand Down Expand Up @@ -351,6 +358,16 @@ const ImportFromSecretRecoveryPhrase = ({
termsOfUse();
}, [termsOfUse]);

useEffect(
() => () => {
if (passwordSetupAttemptTraceCtxRef.current) {
bufferedEndTrace({ name: TraceName.OnboardingPasswordSetupAttempt });
passwordSetupAttemptTraceCtxRef.current = null;
}
},
[],
);

const updateBiometryChoice = async (biometryChoice) => {
await updateAuthTypeStorageFlags(biometryChoice);
setBiometryChoice(biometryChoice);
Expand Down Expand Up @@ -473,6 +490,15 @@ const ImportFromSecretRecoveryPhrase = ({
return;
}
setCurrentStep(currentStep + 1);
// Start the trace when moving to the password setup step
const onboardingTraceCtx = route.params?.onboardingTraceCtx;
if (onboardingTraceCtx) {
passwordSetupAttemptTraceCtxRef.current = bufferedTrace({
name: TraceName.OnboardingPasswordSetupAttempt,
op: TraceOperation.OnboardingUserJourney,
parentContext: onboardingTraceCtx,
});
}
};

const isContinueButtonDisabled = useMemo(
Expand Down Expand Up @@ -556,6 +582,9 @@ const ImportFromSecretRecoveryPhrase = ({
!onboardingWizard && setOnboardingWizardStep(1);

fetchAccountsWithActivity();

bufferedEndTrace({ name: TraceName.OnboardingExistingSrpImport });
bufferedEndTrace({ name: TraceName.OnboardingJourneyOverall });
const resetAction = CommonActions.reset({
index: 1,
routes: [
Expand Down Expand Up @@ -593,6 +622,17 @@ const ImportFromSecretRecoveryPhrase = ({
wallet_setup_type: 'import',
error_type: error.toString(),
});

const onboardingTraceCtx = route.params?.onboardingTraceCtx;
if (onboardingTraceCtx) {
bufferedTrace({
name: TraceName.OnboardingPasswordSetupError,
op: TraceOperation.OnboardingUserJourney,
parentContext: onboardingTraceCtx,
tags: { errorMessage: error.toString() },
});
bufferedEndTrace({ name: TraceName.OnboardingPasswordSetupError });
}
}
}
};
Expand Down Expand Up @@ -1072,10 +1112,6 @@ ImportFromSecretRecoveryPhrase.propTypes = {
* Action to set onboarding wizard step
*/
setOnboardingWizardStep: PropTypes.func,
/**
* Object that represents the current route info like params passed to it
*/
route: PropTypes.object,
/**
* Action to save onboarding event
*/
Expand Down
19 changes: 19 additions & 0 deletions app/components/Views/ImportFromSecretRecoveryPhrase/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import Clipboard from '@react-native-clipboard/clipboard';
import { MIN_PASSWORD_LENGTH } from '../../../util/password';
import { BIOMETRY_TYPE } from 'react-native-keychain';
import AUTHENTICATION_TYPE from '../../../constants/userProperties';
import { TraceName } from '../../../util/trace';

// Mock the clipboard
jest.mock('@react-native-clipboard/clipboard', () => ({
Expand All @@ -36,6 +37,16 @@ jest.mock('../../hooks/useMetrics', () => {
};
});

const mockUseRoute = jest.fn().mockReturnValue({ params: {} });
// mock useRoute
jest.mock('@react-navigation/native', () => {
const actual = jest.requireActual('@react-navigation/native');
return {
...actual,
useRoute: () => mockUseRoute(),
};
});

describe('ImportFromSecretRecoveryPhrase', () => {
beforeEach(() => {
jest.clearAllMocks();
Expand Down Expand Up @@ -800,6 +811,14 @@ describe('ImportFromSecretRecoveryPhrase', () => {

it('Import seed phrase with optin metrics flow', async () => {
mockIsEnabled.mockReturnValue(false);
mockUseRoute.mockReturnValue({
params: {
onboardingTraceCtx: {
name: TraceName.OnboardingNewSrpCreateWallet,
},
},
});

const { getByTestId, getByPlaceholderText } =
await renderCreatePasswordUI();

Expand Down
Loading
Loading