@@ -7,7 +7,7 @@ import type {SearchOption} from '@libs/OptionsListUtils';
77import type { OptionData } from '@libs/ReportUtils' ;
88import type { PersonalDetails } from '@src/types/onyx' ;
99import type { SelectedParticipant } from '@src/types/onyx/NewGroupChatDraft' ;
10- import useGroupDraftRestore from '../../src/pages/NewChatPage/useGroupDraftRestore' ;
10+ import useGroupChatDraftParticipantSync from '../../src/pages/NewChatPage/useGroupDraftRestore' ;
1111
1212const mockUseOnyx = useOnyx as jest . MockedFunction < typeof useOnyx > ;
1313const mockGetUserToInviteOption = OptionsListUtilsModule . getUserToInviteOption as jest . MockedFunction < typeof OptionsListUtilsModule . getUserToInviteOption > ;
@@ -110,7 +110,16 @@ describe('useGroupDraftRestore', () => {
110110 setupUseOnyx ( draftParticipants , draftStatus ) ;
111111
112112 const { rerender} = renderHook ( ( ) =>
113- useGroupDraftRestore ( allPersonalDetailOptions , areAllPersonalDetailOptionsLoaded , { } , { } , CURRENT_USER_EMAIL , CURRENT_USER_ACCOUNT_ID , selectedOptions , setSelectedOptions ) ,
113+ useGroupChatDraftParticipantSync (
114+ allPersonalDetailOptions ,
115+ areAllPersonalDetailOptionsLoaded ,
116+ { } ,
117+ { } ,
118+ CURRENT_USER_EMAIL ,
119+ CURRENT_USER_ACCOUNT_ID ,
120+ selectedOptions ,
121+ setSelectedOptions ,
122+ ) ,
114123 ) ;
115124
116125 return { setSelectedOptions, rerender} ;
@@ -159,7 +168,9 @@ describe('useGroupDraftRestore', () => {
159168 setupUseOnyx ( draftParticipants ) ;
160169
161170 const setSelectedOptions = jest . fn ( ) ;
162- const { rerender} = renderHook ( ( ) => useGroupDraftRestore ( ALL_PERSONAL_DETAIL_OPTIONS , true , { } , { } , CURRENT_USER_EMAIL , CURRENT_USER_ACCOUNT_ID , [ ] , setSelectedOptions ) ) ;
171+ const { rerender} = renderHook ( ( ) =>
172+ useGroupChatDraftParticipantSync ( ALL_PERSONAL_DETAIL_OPTIONS , true , { } , { } , CURRENT_USER_EMAIL , CURRENT_USER_ACCOUNT_ID , [ ] , setSelectedOptions ) ,
173+ ) ;
163174
164175 expect ( setSelectedOptions ) . toHaveBeenCalledTimes ( 1 ) ;
165176
@@ -192,7 +203,7 @@ describe('useGroupDraftRestore', () => {
192203 const { rerender} = renderHook (
193204 ( { draftParticipants} ) => {
194205 setupUseOnyx ( draftParticipants ) ;
195- return useGroupDraftRestore ( ALL_PERSONAL_DETAIL_OPTIONS , true , { } , { } , CURRENT_USER_EMAIL , CURRENT_USER_ACCOUNT_ID , selectedAfterRestore , setSelectedOptions ) ;
206+ return useGroupChatDraftParticipantSync ( ALL_PERSONAL_DETAIL_OPTIONS , true , { } , { } , CURRENT_USER_EMAIL , CURRENT_USER_ACCOUNT_ID , selectedAfterRestore , setSelectedOptions ) ;
196207 } ,
197208 { initialProps : { draftParticipants : initialDraftParticipants } } ,
198209 ) ;
@@ -236,7 +247,7 @@ describe('useGroupDraftRestore', () => {
236247 const { rerender} = renderHook (
237248 ( { draftParticipants} ) => {
238249 setupUseOnyx ( draftParticipants ) ;
239- return useGroupDraftRestore ( ALL_PERSONAL_DETAIL_OPTIONS , true , { } , { } , CURRENT_USER_EMAIL , CURRENT_USER_ACCOUNT_ID , selectedAfterRestore , setSelectedOptions ) ;
250+ return useGroupChatDraftParticipantSync ( ALL_PERSONAL_DETAIL_OPTIONS , true , { } , { } , CURRENT_USER_EMAIL , CURRENT_USER_ACCOUNT_ID , selectedAfterRestore , setSelectedOptions ) ;
240251 } ,
241252 { initialProps : { draftParticipants : initialDraftParticipants } } ,
242253 ) ;
@@ -269,7 +280,7 @@ describe('useGroupDraftRestore', () => {
269280 const { rerender} = renderHook (
270281 ( { draft} ) => {
271282 setupUseOnyx ( draft ) ;
272- return useGroupDraftRestore ( ALL_PERSONAL_DETAIL_OPTIONS , true , { } , { } , CURRENT_USER_EMAIL , CURRENT_USER_ACCOUNT_ID , selectedAfterRestore , setSelectedOptions ) ;
283+ return useGroupChatDraftParticipantSync ( ALL_PERSONAL_DETAIL_OPTIONS , true , { } , { } , CURRENT_USER_EMAIL , CURRENT_USER_ACCOUNT_ID , selectedAfterRestore , setSelectedOptions ) ;
273284 } ,
274285 { initialProps : { draft : draftParticipants } } ,
275286 ) ;
@@ -297,7 +308,7 @@ describe('useGroupDraftRestore', () => {
297308 const { rerender} = renderHook (
298309 ( { draft} ) => {
299310 setupUseOnyx ( draft ) ;
300- return useGroupDraftRestore ( ALL_PERSONAL_DETAIL_OPTIONS , true , { } , { } , CURRENT_USER_EMAIL , CURRENT_USER_ACCOUNT_ID , [ ] , setSelectedOptions ) ;
311+ return useGroupChatDraftParticipantSync ( ALL_PERSONAL_DETAIL_OPTIONS , true , { } , { } , CURRENT_USER_EMAIL , CURRENT_USER_ACCOUNT_ID , [ ] , setSelectedOptions ) ;
301312 } ,
302313 { initialProps : { draft : draftParticipants } } ,
303314 ) ;
@@ -345,7 +356,7 @@ describe('useGroupDraftRestore', () => {
345356 setupUseOnyx ( draftParticipants ) ;
346357
347358 const { rerender} = renderHook (
348- ( { areLoaded} ) => useGroupDraftRestore ( ALL_PERSONAL_DETAIL_OPTIONS , areLoaded , { } , { } , CURRENT_USER_EMAIL , CURRENT_USER_ACCOUNT_ID , [ ] , setSelectedOptions ) ,
359+ ( { areLoaded} ) => useGroupChatDraftParticipantSync ( ALL_PERSONAL_DETAIL_OPTIONS , areLoaded , { } , { } , CURRENT_USER_EMAIL , CURRENT_USER_ACCOUNT_ID , [ ] , setSelectedOptions ) ,
349360 { initialProps : { areLoaded : false } } ,
350361 ) ;
351362
0 commit comments