@@ -87,10 +87,9 @@ describe('FirebaseAnalytics instance tests', () => {
87
87
analyticsInstance . logEvent ( EventName . ADD_PAYMENT_INFO , {
88
88
currency : 'USD'
89
89
} ) ;
90
- // Clear event stack of async FID call.
91
- // For IE: Need then() or else "expect" runs immediately on FID resolve
92
- // before the other statements in initializeGAId.
93
- await fidDeferred . promise . then ( ) ;
90
+ // Clear event stack of initialization promise.
91
+ const { initializedIdPromisesMap } = getGlobalVars ( ) ;
92
+ await Promise . all ( Object . values ( initializedIdPromisesMap ) ) ;
94
93
expect ( gtagStub ) . to . have . been . calledWith ( 'js' ) ;
95
94
expect ( gtagStub ) . to . have . been . calledWith (
96
95
GtagCommand . CONFIG ,
@@ -101,10 +100,6 @@ describe('FirebaseAnalytics instance tests', () => {
101
100
update : true
102
101
}
103
102
) ;
104
- // Clear event stack of initialization promise.
105
- const { initializedIdPromisesMap } = getGlobalVars ( ) ;
106
- await Promise . all ( Object . values ( initializedIdPromisesMap ) ) ;
107
- // await Promise.resolve().then(() => {});
108
103
expect ( gtagStub ) . to . have . been . calledWith (
109
104
GtagCommand . EVENT ,
110
105
EventName . ADD_PAYMENT_INFO ,
@@ -159,10 +154,9 @@ describe('FirebaseAnalytics instance tests', () => {
159
154
analyticsInstance . logEvent ( EventName . ADD_PAYMENT_INFO , {
160
155
currency : 'USD'
161
156
} ) ;
162
- // Clear event stack of async FID call.
163
- // For IE: Need then() or else "expect" runs immediately on FID resolve
164
- // before the other statements in initializeGAId.
165
- await fidDeferred . promise . then ( ) ;
157
+ // Clear event stack of initialization promise.
158
+ const { initializedIdPromisesMap } = getGlobalVars ( ) ;
159
+ await Promise . all ( Object . values ( initializedIdPromisesMap ) ) ;
166
160
expect ( gtagStub ) . to . have . been . calledWith ( 'js' ) ;
167
161
expect ( gtagStub ) . to . have . been . calledWith (
168
162
GtagCommand . CONFIG ,
@@ -173,9 +167,6 @@ describe('FirebaseAnalytics instance tests', () => {
173
167
update : true
174
168
}
175
169
) ;
176
- // Clear event stack of initialization promise.
177
- const { initializedIdPromisesMap } = getGlobalVars ( ) ;
178
- await Promise . all ( Object . values ( initializedIdPromisesMap ) ) ;
179
170
expect ( gtagStub ) . to . have . been . calledWith (
180
171
GtagCommand . EVENT ,
181
172
EventName . ADD_PAYMENT_INFO ,
0 commit comments