File tree Expand file tree Collapse file tree
packages/fxa-settings/src/pages/PostVerify/ThirdPartyAuthCallback Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -148,22 +148,33 @@ describe('ThirdPartyAuthCallback component', () => {
148148 finishOAuthFlowHandler : mockFinishOAuthFlowHandler ,
149149 } ) ;
150150
151- renderWith ( ) ;
151+ renderWith ( {
152+ flowQueryParams : {
153+ flowId : 'bbbb' ,
154+ flowBeginTime : 1734112296874 ,
155+ } ,
156+ integration : {
157+ ...mockThirdPartyAuthCallbackIntegration ( ) ,
158+ getFxAParams : ( ) =>
159+ '?flowId=aaaa&flowBeginTime=1734112296000&utm_campaign=testo' ,
160+ } as ModelsModule . ThirdPartyAuthCallbackIntegration ,
161+ } ) ;
152162
153163 await waitFor ( ( ) => {
154164 expect ( mockVerifyAccountThirdParty ) . toHaveBeenCalledWith (
155165 'code' ,
156166 'provider' ,
157167 undefined ,
158168 {
169+ utmCampaign : 'testo' ,
159170 flowId : 'aaaa' ,
160171 flowBeginTime : 1734112296000 ,
161172 }
162173 ) ;
163174 } ) ;
164175
165176 expect ( hardNavigateSpy ) . toBeCalledWith (
166- '/post_verify/third_party_auth/callback?flowId=aaaa&flowBeginTime=1734112296000'
177+ '/post_verify/third_party_auth/callback?flowId=aaaa&flowBeginTime=1734112296000&utm_campaign=testo '
167178 ) ;
168179 } ) ;
169180
Original file line number Diff line number Diff line change @@ -140,6 +140,7 @@ const ThirdPartyAuthCallback = ({
140140 originalService ,
141141 queryParamsToMetricsContext ( {
142142 ...( ( flowQueryParams as Record < string , string > ) || { } ) ,
143+ ...Object . fromEntries ( params . entries ( ) ) ,
143144 // Important be sure to overwrite current flowQueryParams with provided fxa parameters.
144145 // If we don't do this, we will lose metrics.
145146 flowId,
You can’t perform that action at this time.
0 commit comments