Skip to content

Commit d929370

Browse files
Test fix
1 parent 4c3fa4c commit d929370

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

packages/firestore/src/local/tab_notification_channel.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export interface TabNotificationChannel {
4646
/** Associates a new Mutation Batch with the current Firestore instance. */
4747
addPendingMutation(batchId: BatchId): void;
4848

49-
/** Removes a Mutation Batch from the current Firestore instance .*/
49+
/** Removes a Mutation Batch from the current Firestore instance. */
5050
removePendingMutation(batchId: BatchId): void;
5151

5252
/** Gets the minimum mutation batch for all active instances. */

packages/firestore/test/unit/local/local_storage_notification_channel.test.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,11 @@ describe('LocalStorageNotificationChannel', () => {
138138
});
139139

140140
describe('combines instance data', () => {
141-
const initialTargets = [3, 4];
141+
let browserCallback;
142142
let eventCallback;
143143

144144
beforeEach(() => {
145+
browserCallback = window.addEventListener;
145146
window.addEventListener = (type, callback) => {
146147
expect(type).to.be.equal('storage');
147148
eventCallback = callback;
@@ -155,6 +156,10 @@ describe('LocalStorageNotificationChannel', () => {
155156
});
156157
});
157158

159+
afterEach(() => {
160+
window.addEventListener = browserCallback;
161+
});
162+
158163
const verifyState = (minBatchId: BatchId, activeTargets: TargetId[]) => {
159164
const actualTargets = Array.from(
160165
notificationChannel.getAllActiveQueryTargets()

0 commit comments

Comments
 (0)