@@ -14,7 +14,7 @@ const mockStore = configureMockStore(middlewares);
1414
1515describe ( 'User Management Actions' , ( ) => {
1616 let store ;
17-
17+
1818 beforeEach ( ( ) => {
1919 store = mockStore ( { } ) ;
2020 vi . clearAllMocks ( ) ;
@@ -46,7 +46,7 @@ describe('User Management Actions', () => {
4646
4747 it ( 'should update user to active status' , async ( ) => {
4848 const reactivationDate = null ;
49-
49+
5050 axios . patch . mockResolvedValueOnce ( { data : { } } ) ;
5151
5252 await store . dispatch ( actions . updateUserStatus ( mockUser , UserStatus . Active , reactivationDate ) ) ;
@@ -143,7 +143,7 @@ describe('User Management Actions', () => {
143143 ) ;
144144 } ) ;
145145
146-
146+
147147 } ) ;
148148
149149 describe ( 'updateUserFinalDayStatus' , ( ) => {
@@ -205,6 +205,7 @@ describe('User Management Actions', () => {
205205 { id : 1 , name : 'John Doe' , email : 'john@example.com' } ,
206206 { id : 2 , name : 'Jane Smith' , email : 'jane@example.com' }
207207 ] ;
208+ const mockSource = 'Report' ;
208209
209210 axios . get . mockResolvedValueOnce ( { data : mockBasicInfo } ) ;
210211
@@ -213,20 +214,20 @@ describe('User Management Actions', () => {
213214 { type : 'RECEIVE_USER_PROFILE_BASIC_INFO' , payload : mockBasicInfo }
214215 ] ;
215216
216- await store . dispatch ( actions . getUserProfileBasicInfo ( ) ) ;
217+ await store . dispatch ( actions . getUserProfileBasicInfo ( { source : mockSource } ) ) ;
217218 expect ( store . getActions ( ) ) . toEqual ( expectedActions ) ;
218- expect ( axios . get ) . toHaveBeenCalledWith ( ENDPOINTS . USER_PROFILE_BASIC_INFO ) ;
219+ expect ( axios . get ) . toHaveBeenCalledWith ( ENDPOINTS . USER_PROFILE_BASIC_INFO ( mockSource ) ) ;
219220 } ) ;
220221
221222 it ( 'should handle errors when fetching basic info' , async ( ) => {
222223 axios . get . mockRejectedValueOnce ( new Error ( 'Network error' ) ) ;
223-
224+ const mockSource = '' ;
224225 const expectedActions = [
225226 { type : 'FETCH_USER_PROFILE_BASIC_INFO' } ,
226227 { type : 'FETCH_USER_PROFILE_BASIC_INFO_ERROR' }
227228 ] ;
228229
229- await store . dispatch ( actions . getUserProfileBasicInfo ( ) ) ;
230+ await store . dispatch ( actions . getUserProfileBasicInfo ( { source : mockSource } ) ) ;
230231 expect ( store . getActions ( ) ) . toEqual ( expectedActions ) ;
231232 } ) ;
232233 } ) ;
@@ -276,4 +277,4 @@ describe('User Management Actions', () => {
276277 expect ( store . getActions ( ) ) . toContainEqual ( expectedAction ) ;
277278 } ) ;
278279 } ) ;
279- } ) ;
280+ } ) ;
0 commit comments