Skip to content

Commit d878f45

Browse files
committed
local_store.test.ts: fix build
1 parent dfca741 commit d878f45

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

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

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ import {
4242
localStoreGetHighestUnacknowledgedBatchId,
4343
localStoreGetTargetData,
4444
localStoreGetNamedQuery,
45-
localStoreSetIndexAutoCreationEnabled,
45+
localStoreSetFieldIndexManagementApi,
4646
localStoreHasNewerBundle,
4747
localStoreWriteLocally,
4848
LocalWriteResult,
@@ -122,6 +122,7 @@ import {
122122
import { CountingQueryEngine } from './counting_query_engine';
123123
import * as persistenceHelpers from './persistence_test_helpers';
124124
import { JSON_SERIALIZER } from './persistence_test_helpers';
125+
import { FieldIndexManagementApiImpl } from '../../../src/index/field_index_management';
125126

126127
export interface LocalStoreComponents {
127128
queryEngine: CountingQueryEngine;
@@ -660,14 +661,15 @@ function genericLocalStoreTests(
660661
}
661662

662663
it('localStoreSetIndexAutoCreationEnabled()', () => {
663-
localStoreSetIndexAutoCreationEnabled(localStore, true);
664-
expect(queryEngine.indexAutoCreationEnabled).to.be.true;
665-
localStoreSetIndexAutoCreationEnabled(localStore, false);
666-
expect(queryEngine.indexAutoCreationEnabled).to.be.false;
667-
localStoreSetIndexAutoCreationEnabled(localStore, true);
668-
expect(queryEngine.indexAutoCreationEnabled).to.be.true;
669-
localStoreSetIndexAutoCreationEnabled(localStore, false);
670-
expect(queryEngine.indexAutoCreationEnabled).to.be.false;
664+
const api1 = new FieldIndexManagementApiImpl();
665+
const api2 = new FieldIndexManagementApiImpl();
666+
667+
localStoreSetFieldIndexManagementApi(localStore, api1);
668+
expect(queryEngine.fieldIndexManagementApi).to.equal(api1);
669+
localStoreSetFieldIndexManagementApi(localStore, api2);
670+
expect(queryEngine.fieldIndexManagementApi).to.equal(api2);
671+
localStoreSetFieldIndexManagementApi(localStore, api1);
672+
expect(queryEngine.fieldIndexManagementApi).to.equal(api1);
671673
});
672674

673675
it('handles SetMutation', () => {

0 commit comments

Comments
 (0)