Skip to content

Commit 3da229f

Browse files
committed
Revert but keep callcount log
1 parent c588951 commit 3da229f

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

packages/analytics/index.test.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ describe('FirebaseAnalytics instance tests', () => {
7777
delete window['dataLayer'];
7878
removeGtagScript();
7979
});
80+
afterEach(() => {
81+
gtagStub.reset();
82+
});
8083
it('Contains reference to parent app', () => {
8184
expect(analyticsInstance.app).to.equal(app);
8285
});
@@ -111,7 +114,6 @@ describe('FirebaseAnalytics instance tests', () => {
111114
currency: 'USD'
112115
}
113116
);
114-
gtagStub.reset();
115117
});
116118
it('setCurrentScreen() method exists on instance', () => {
117119
expect(analyticsInstance.setCurrentScreen).to.be.instanceOf(Function);
@@ -151,8 +153,11 @@ describe('FirebaseAnalytics instance tests', () => {
151153
delete window[customDataLayerName];
152154
removeGtagScript();
153155
});
156+
afterEach(() => {
157+
gtagStub.reset();
158+
});
154159
it('Calls gtag correctly on logEvent (instance)', async () => {
155-
analyticsInstance.logEvent(EventName.ADD_SHIPPING_INFO, {
160+
analyticsInstance.logEvent(EventName.ADD_PAYMENT_INFO, {
156161
currency: 'USD'
157162
});
158163
// Clear event stack of async FID call.
@@ -174,13 +179,12 @@ describe('FirebaseAnalytics instance tests', () => {
174179
await Promise.all(Object.values(initializedIdPromisesMap));
175180
expect(gtagStub).to.have.been.calledWith(
176181
GtagCommand.EVENT,
177-
EventName.ADD_SHIPPING_INFO,
182+
EventName.ADD_PAYMENT_INFO,
178183
{
179184
'send_to': 'abcd-efgh',
180185
currency: 'USD'
181186
}
182187
);
183-
gtagStub.reset();
184188
});
185189
});
186190

0 commit comments

Comments
 (0)