@@ -134,7 +134,8 @@ describe('Profile Metrics', function () {
134134 {
135135 fixtures : new FixtureBuilderV2 ( )
136136 . withMetaMetricsController ( {
137- participateInMetaMetrics : true ,
137+ completedMetaMetricsOnboarding : true ,
138+ optedIn : true ,
138139 } )
139140 . build ( ) ,
140141 testSpecificMock : async ( server : Mockttp ) => [
@@ -173,7 +174,8 @@ describe('Profile Metrics', function () {
173174 {
174175 fixtures : new FixtureBuilderV2 ( )
175176 . withMetaMetricsController ( {
176- participateInMetaMetrics : true ,
177+ completedMetaMetricsOnboarding : true ,
178+ optedIn : true ,
177179 } )
178180 . build ( ) ,
179181 testSpecificMock : async ( server : Mockttp ) => [
@@ -230,54 +232,59 @@ describe('Profile Metrics', function () {
230232 [
231233 {
232234 title : 'when MetaMetrics is disabled' ,
233- participateInMetaMetrics : false ,
235+ completedMetaMetricsOnboarding : true ,
236+ optedIn : false ,
234237 pna25Acknowledged : true ,
235238 } ,
236239 {
237240 title : 'when the user has not acknowledged the privacy change' ,
238- participateInMetaMetrics : true ,
241+ completedMetaMetricsOnboarding : true ,
242+ optedIn : true ,
239243 pna25Acknowledged : false ,
240244 } ,
241- ] . forEach ( ( { title, participateInMetaMetrics, pna25Acknowledged } ) => {
242- describe ( title , function ( ) {
243- it ( 'does not send existing accounts to the API on wallet unlock' , async function ( ) {
244- await withFixtures (
245- {
246- fixtures : new FixtureBuilderV2 ( )
247- . withMetaMetricsController ( {
248- participateInMetaMetrics,
249- } )
250- . withAppStateController ( {
251- pna25Acknowledged,
252- } )
253- . build ( ) ,
254- testSpecificMock : async ( server : Mockttp ) => [
255- await mockAuthService ( server ) ,
256- await mockRemoteFeatureFlags ( ) ( server ) ,
257- ] ,
258- title : this . test ?. fullTitle ( ) ,
259- } ,
260- async ( {
261- driver,
262- mockedEndpoint,
263- } : {
264- driver : Driver ;
265- mockedEndpoint : MockedEndpoint [ ] ;
266- } ) => {
267- await login ( driver ) ;
245+ ] . forEach (
246+ ( { title, optedIn, completedMetaMetricsOnboarding, pna25Acknowledged } ) => {
247+ describe ( title , function ( ) {
248+ it ( 'does not send existing accounts to the API on wallet unlock' , async function ( ) {
249+ await withFixtures (
250+ {
251+ fixtures : new FixtureBuilderV2 ( )
252+ . withMetaMetricsController ( {
253+ optedIn,
254+ completedMetaMetricsOnboarding,
255+ } )
256+ . withAppStateController ( {
257+ pna25Acknowledged,
258+ } )
259+ . build ( ) ,
260+ testSpecificMock : async ( server : Mockttp ) => [
261+ await mockAuthService ( server ) ,
262+ await mockRemoteFeatureFlags ( ) ( server ) ,
263+ ] ,
264+ title : this . test ?. fullTitle ( ) ,
265+ } ,
266+ async ( {
267+ driver,
268+ mockedEndpoint,
269+ } : {
270+ driver : Driver ;
271+ mockedEndpoint : MockedEndpoint [ ] ;
272+ } ) => {
273+ await login ( driver ) ;
268274
269- await driver . delay ( 5000 ) ;
275+ await driver . delay ( 5000 ) ;
270276
271- const [ authCall ] = mockedEndpoint ;
272- const requests = await authCall . getSeenRequests ( ) ;
273- assert . equal (
274- requests . length ,
275- 0 ,
276- 'Expected no requests to the auth API.' ,
277- ) ;
278- } ,
279- ) ;
277+ const [ authCall ] = mockedEndpoint ;
278+ const requests = await authCall . getSeenRequests ( ) ;
279+ assert . equal (
280+ requests . length ,
281+ 0 ,
282+ 'Expected no requests to the auth API.' ,
283+ ) ;
284+ } ,
285+ ) ;
286+ } ) ;
280287 } ) ;
281- } ) ;
282- } ) ;
288+ } ,
289+ ) ;
283290} ) ;
0 commit comments