Skip to content

Commit 1c2fa18

Browse files
Test fix
1 parent 4c3fa4c commit 1c2fa18

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

packages/firestore/src/local/tab_notification_channel.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import {
2525
validateNamedOptionalType,
2626
validateNamedType
2727
} from '../util/input_validation';
28-
import { StringMap } from '../util/types';
2928

3029
// Prefix keys used in WebStorage.
3130
const FIRESTORE_PREFIX = 'fs';
@@ -46,7 +45,7 @@ export interface TabNotificationChannel {
4645
/** Associates a new Mutation Batch with the current Firestore instance. */
4746
addPendingMutation(batchId: BatchId): void;
4847

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

5251
/** 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()

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

-4
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,9 @@ import { MemoryPersistence } from '../../../src/local/memory_persistence';
2020
import { SimpleDb } from '../../../src/local/simple_db';
2121
import { JsonProtoSerializer } from '../../../src/remote/serializer';
2222
import {
23-
InstanceState,
2423
LocalStorageNotificationChannel,
2524
TabNotificationChannel
2625
} from '../../../src/local/tab_notification_channel';
27-
import { AutoId } from '../../../src/util/misc';
28-
import { AsyncQueue } from '../../../src/util/async_queue';
29-
import { StringMap } from '../../../src/util/types';
3026
import { BatchId, InstanceKey, TargetId } from '../../../src/core/types';
3127

3228
/** The persistence prefix used for testing in IndexedBD and LocalStorage. */

0 commit comments

Comments
 (0)