@@ -15,7 +15,7 @@ jest.mock('@deriv/hooks', () => ({
15
15
useGetStatus : jest . fn ( ( ) => ( {
16
16
client_kyc_status : { poi_status : 'rejected' , poa_status : 'verified' , valid_tin : 1 } ,
17
17
} ) ) ,
18
- useIsSelectedMT5AccountCreated : jest . fn ( ( ) => ( { is_selected_MT5_account_created : true } ) ) ,
18
+ useIsSelectedMT5AccountCreated : jest . fn ( ( ) => ( { is_selected_MT5_account_created : false } ) ) ,
19
19
} ) ) ;
20
20
21
21
jest . mock ( '@deriv/quill-icons' , ( ) => ( {
@@ -68,8 +68,8 @@ describe('<VerificationDocsListModal />', () => {
68
68
document . body . removeChild ( modal_root_el ) ;
69
69
} ) ;
70
70
71
- it ( 'should render the modal' , ( ) => {
72
- ( useIsSelectedMT5AccountCreated as jest . Mock ) . mockReturnValueOnce ( { is_selected_MT5_account_created : true } ) ;
71
+ it ( 'should render the modal with details when mt5 account is created ' , ( ) => {
72
+ ( useIsSelectedMT5AccountCreated as jest . Mock ) . mockReturnValue ( { is_selected_MT5_account_created : true } ) ;
73
73
( useDevice as jest . Mock ) . mockReturnValueOnce ( { isMobile : false } ) ;
74
74
( useGetStatus as jest . Mock ) . mockReturnValueOnce ( {
75
75
client_kyc_status : {
@@ -79,13 +79,53 @@ describe('<VerificationDocsListModal />', () => {
79
79
} ,
80
80
} ) ;
81
81
renderComponent ( { } ) ;
82
- expect ( screen . getByText ( 'Verify your account' ) ) . toBeInTheDocument ( ) ;
82
+ expect ( screen . getByText ( 'Verification required' ) ) . toBeInTheDocument ( ) ;
83
+ expect ( screen . getByText ( 'Your account needs verification.' ) ) . toBeInTheDocument ( ) ;
84
+ expect ( screen . getByText ( 'Proof of identity' ) ) . toBeInTheDocument ( ) ;
85
+ expect ( screen . getByText ( 'Proof of address' ) ) . toBeInTheDocument ( ) ;
86
+ expect ( screen . queryByText ( 'Personal Details' ) ) . not . toBeInTheDocument ( ) ;
83
87
} ) ;
84
88
85
- it ( 'should show the DerivLightUploadPoiIcon and text' , ( ) => {
86
- ( useIsSelectedMT5AccountCreated as jest . Mock ) . mockReturnValueOnce ( { is_selected_MT5_account_created : true } ) ;
89
+ it ( 'should render the modal with details when mt5 account is not created' , ( ) => {
90
+ ( useIsSelectedMT5AccountCreated as jest . Mock ) . mockReturnValue ( { is_selected_MT5_account_created : false } ) ;
91
+ ( useGetStatus as jest . Mock ) . mockReturnValueOnce ( {
92
+ client_kyc_status : {
93
+ poi_status : 'pending' ,
94
+ poa_status : 'none' ,
95
+ valid_tin : 0 ,
96
+ } ,
97
+ } ) ;
87
98
renderComponent ( { } ) ;
88
99
expect ( screen . getByText ( 'DerivLightUploadPoiIcon' ) ) . toBeInTheDocument ( ) ;
100
+ expect ( screen . getByText ( 'Complete your profile' ) ) . toBeInTheDocument ( ) ;
101
+ expect ( screen . getByText ( 'Complete your account details to proceed:' ) ) . toBeInTheDocument ( ) ;
102
+ expect ( screen . getByText ( 'Proof of identity' ) ) . toBeInTheDocument ( ) ;
103
+ expect ( screen . getByText ( 'Proof of address' ) ) . toBeInTheDocument ( ) ;
104
+ expect ( screen . queryByText ( 'Personal Details' ) ) . toBeInTheDocument ( ) ;
105
+ } ) ;
106
+ it ( 'should render the modal with details when platform is not mt5' , ( ) => {
107
+ ( useIsSelectedMT5AccountCreated as jest . Mock ) . mockReturnValue ( { is_selected_MT5_account_created : false } ) ;
108
+ ( useGetStatus as jest . Mock ) . mockReturnValueOnce ( {
109
+ client_kyc_status : {
110
+ poi_status : 'pending' ,
111
+ poa_status : 'none' ,
112
+ } ,
113
+ } ) ;
114
+ const mock_store = mockStore ( {
115
+ traders_hub : {
116
+ is_verification_docs_list_modal_visible : true ,
117
+ setVerificationModalOpen : jest . fn ( ) ,
118
+ } ,
119
+ common : {
120
+ platform : '' ,
121
+ } ,
122
+ } ) ;
123
+ renderComponent ( { store : mock_store } ) ;
124
+ expect ( screen . getByText ( 'DerivLightUploadPoiIcon' ) ) . toBeInTheDocument ( ) ;
125
+ expect ( screen . getByText ( 'Verification required' ) ) . toBeInTheDocument ( ) ;
89
126
expect ( screen . getByText ( 'Your account needs verification.' ) ) . toBeInTheDocument ( ) ;
127
+ expect ( screen . getByText ( 'Proof of identity' ) ) . toBeInTheDocument ( ) ;
128
+ expect ( screen . getByText ( 'Proof of address' ) ) . toBeInTheDocument ( ) ;
129
+ expect ( screen . queryByText ( 'Personal Details' ) ) . not . toBeInTheDocument ( ) ;
90
130
} ) ;
91
131
} ) ;
0 commit comments