@@ -204,7 +204,7 @@ describe('Clerk singleton', () => {
204204 const sut = new Clerk ( productionPublishableKey ) ;
205205 await sut . load ( ) ;
206206 await sut . setActive ( { session : mockSession as any as ActiveSessionResource } ) ;
207- expect ( mockSession . touch ) . toHaveBeenCalled ( ) ;
207+ expect ( mockSession . touch ) . toHaveBeenCalledWith ( { intent : 'select_session' } ) ;
208208 } ) ;
209209
210210 describe ( 'with `touchSession` set to false' , ( ) => {
@@ -215,7 +215,7 @@ describe('Clerk singleton', () => {
215215 const sut = new Clerk ( productionPublishableKey ) ;
216216 await sut . load ( { touchSession : false } ) ;
217217 await sut . setActive ( { session : mockSession as any as ActiveSessionResource } ) ;
218- expect ( mockSession . touch ) . toHaveBeenCalled ( ) ;
218+ expect ( mockSession . touch ) . toHaveBeenCalledWith ( { intent : 'select_session' } ) ;
219219 } ) ;
220220 } ) ;
221221
@@ -230,7 +230,7 @@ describe('Clerk singleton', () => {
230230 const sut = new Clerk ( productionPublishableKey ) ;
231231 await sut . load ( ) ;
232232 await sut . setActive ( { session : mockSession as any as ActiveSessionResource } ) ;
233- expect ( mockSession . touch ) . toHaveBeenCalled ( ) ;
233+ expect ( mockSession . touch ) . toHaveBeenCalledWith ( { intent : 'select_session' } ) ;
234234 } ) ;
235235
236236 it ( 'sets __session and __client_uat cookie before calling __unstable__onBeforeSetActive' , async ( ) => {
@@ -252,7 +252,7 @@ describe('Clerk singleton', () => {
252252 mockClientFetch . mockReturnValue ( Promise . resolve ( { signedInSessions : [ mockSession ] } ) ) ;
253253
254254 ( window as any ) . __unstable__onAfterSetActive = ( ) => {
255- expect ( mockSession . touch ) . toHaveBeenCalled ( ) ;
255+ expect ( mockSession . touch ) . toHaveBeenCalledWith ( { intent : 'select_session' } ) ;
256256 expect ( beforeEmitMock ) . toHaveBeenCalled ( ) ;
257257 } ;
258258
@@ -299,7 +299,7 @@ describe('Clerk singleton', () => {
299299
300300 await waitFor ( ( ) => {
301301 expect ( executionOrder ) . toEqual ( [ 'session.touch' , 'set cookie' , 'before emit' ] ) ;
302- expect ( mockSession2 . touch ) . toHaveBeenCalled ( ) ;
302+ expect ( mockSession2 . touch ) . toHaveBeenCalledWith ( { intent : 'select_session' } ) ;
303303 expect ( mockSession2 . getToken ) . toHaveBeenCalled ( ) ;
304304 expect ( beforeEmitMock ) . toHaveBeenCalledWith ( mockSession2 ) ;
305305 expect ( sut . session ) . toMatchObject ( mockSession2 ) ;
@@ -332,7 +332,7 @@ describe('Clerk singleton', () => {
332332
333333 await waitFor ( ( ) => {
334334 expect ( executionOrder ) . toEqual ( [ 'session.touch' , 'set cookie' , 'before emit' ] ) ;
335- expect ( mockSession . touch ) . toHaveBeenCalled ( ) ;
335+ expect ( mockSession . touch ) . toHaveBeenCalledWith ( { intent : 'select_org' } ) ;
336336 expect ( mockSession . getToken ) . toHaveBeenCalled ( ) ;
337337 expect ( ( mockSession as any as ActiveSessionResource ) ?. lastActiveOrganizationId ) . toEqual ( 'org_id' ) ;
338338 expect ( beforeEmitMock ) . toHaveBeenCalledWith ( mockSession ) ;
@@ -371,7 +371,7 @@ describe('Clerk singleton', () => {
371371 await sut . setActive ( { organization : 'some-org-slug' } ) ;
372372
373373 await waitFor ( ( ) => {
374- expect ( mockSession2 . touch ) . toHaveBeenCalled ( ) ;
374+ expect ( mockSession2 . touch ) . toHaveBeenCalledWith ( { intent : 'select_org' } ) ;
375375 expect ( mockSession2 . getToken ) . toHaveBeenCalled ( ) ;
376376 expect ( ( mockSession2 as any as ActiveSessionResource ) ?. lastActiveOrganizationId ) . toEqual ( 'org_id' ) ;
377377 expect ( sut . session ) . toMatchObject ( mockSession2 ) ;
@@ -454,7 +454,7 @@ describe('Clerk singleton', () => {
454454 const sut = new Clerk ( productionPublishableKey ) ;
455455 await sut . load ( ) ;
456456 await sut . setActive ( { session : mockSession as any as PendingSessionResource , navigate } ) ;
457- expect ( mockSession . touch ) . toHaveBeenCalled ( ) ;
457+ expect ( mockSession . touch ) . toHaveBeenCalledWith ( { intent : 'select_session' } ) ;
458458 expect ( navigate ) . toHaveBeenCalled ( ) ;
459459 } ) ;
460460
@@ -479,7 +479,7 @@ describe('Clerk singleton', () => {
479479 await sut . setActive ( { organization : { id : 'org_id' } as Organization , beforeEmit : beforeEmitMock } ) ;
480480
481481 expect ( executionOrder ) . toEqual ( [ 'session.touch' , 'before emit' ] ) ;
482- expect ( mockSession . touch ) . toHaveBeenCalled ( ) ;
482+ expect ( mockSession . touch ) . toHaveBeenCalledWith ( { intent : 'select_org' } ) ;
483483 expect ( ( mockSession as any as ActiveSessionResource ) ?. lastActiveOrganizationId ) . toEqual ( 'org_id' ) ;
484484 expect ( mockSession . getToken ) . toHaveBeenCalled ( ) ;
485485 expect ( beforeEmitMock ) . toHaveBeenCalledWith ( mockSession ) ;
@@ -534,7 +534,7 @@ describe('Clerk singleton', () => {
534534 const sut = new Clerk ( productionPublishableKey ) ;
535535 await sut . load ( ) ;
536536 await sut . setActive ( { session : mockSession as any as PendingSessionResource } ) ;
537- expect ( mockSession . touch ) . toHaveBeenCalled ( ) ;
537+ expect ( mockSession . touch ) . toHaveBeenCalledWith ( { intent : 'select_session' } ) ;
538538 } ) ;
539539
540540 it ( 'does not call __unstable__onBeforeSetActive before session.touch' , async ( ) => {
@@ -575,7 +575,7 @@ describe('Clerk singleton', () => {
575575 } ,
576576 } ) ;
577577 await sut . setActive ( { session : mockSession as any as PendingSessionResource } ) ;
578- expect ( mockSession . touch ) . toHaveBeenCalled ( ) ;
578+ expect ( mockSession . touch ) . toHaveBeenCalledWith ( { intent : 'select_session' } ) ;
579579 expect ( sut . navigate ) . toHaveBeenCalledWith ( '/choose-organization' ) ;
580580 } ) ;
581581
@@ -587,7 +587,7 @@ describe('Clerk singleton', () => {
587587 const sut = new Clerk ( productionPublishableKey ) ;
588588 await sut . load ( ) ;
589589 await sut . setActive ( { session : mockSession as any as PendingSessionResource , navigate } ) ;
590- expect ( mockSession . touch ) . toHaveBeenCalled ( ) ;
590+ expect ( mockSession . touch ) . toHaveBeenCalledWith ( { intent : 'select_session' } ) ;
591591 expect ( navigate ) . toHaveBeenCalled ( ) ;
592592 } ) ;
593593 } ) ;
@@ -660,7 +660,7 @@ describe('Clerk singleton', () => {
660660 await sut . setActive ( { organization : 'some-org-slug' } ) ;
661661
662662 await waitFor ( ( ) => {
663- expect ( mockSessionWithOrganization . touch ) . toHaveBeenCalled ( ) ;
663+ expect ( mockSessionWithOrganization . touch ) . toHaveBeenCalledWith ( { intent : 'select_org' } ) ;
664664 expect ( mockSessionWithOrganization . getToken ) . toHaveBeenCalled ( ) ;
665665 expect ( ( mockSessionWithOrganization as any as ActiveSessionResource ) ?. lastActiveOrganizationId ) . toEqual (
666666 'org_id' ,
0 commit comments