Skip to content

Commit 05338d8

Browse files
committed
test fixes
1 parent 28c6da9 commit 05338d8

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

packages/firestore/src/lite-api/vector_value.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export class VectorValue {
6262
/** Returns a JSON-serializable representation of this `VectorValue` instance. */
6363
toJSON(): object {
6464
return {
65-
type: 'firestore/vectorvalue/1.0',
65+
type: VectorValue._jsonSchemaVersion,
6666
vectorValues: this._values
6767
};
6868
}

packages/firestore/test/unit/api/geo_point.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,17 +106,17 @@ describe('GeoPoint', () => {
106106
expect(new GeoPoint(1, 2).toJSON()).to.deep.equal({
107107
latitude: 1,
108108
longitude: 2,
109-
'type': 'firestore/geopoint/1.0'
109+
'type': GeoPoint._jsonSchemaVersion
110110
});
111111
expect(new GeoPoint(0, 0).toJSON()).to.deep.equal({
112112
latitude: 0,
113113
longitude: 0,
114-
'type': 'firestore/geopoint/1.0'
114+
'type': GeoPoint._jsonSchemaVersion
115115
});
116116
expect(new GeoPoint(90, 180).toJSON()).to.deep.equal({
117117
latitude: 90,
118118
longitude: 180,
119-
'type': 'firestore/geopoint/1.0'
119+
'type': GeoPoint._jsonSchemaVersion
120120
});
121121
});
122122
it('fromJSON does not throw', () => {

packages/firestore/test/unit/api/vector_value.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ describe('VectorValue', () => {
2929
});
3030

3131
it('fromJSON parameter order does not matter', () => {
32-
const type = 'firestore/vectorvalue/1.0';
32+
const type = VectorValue._jsonSchemaVersion;
3333
const vectorValues = [1, 2, 3];
3434
const control = new VectorValue(vectorValues);
3535

@@ -44,15 +44,15 @@ describe('VectorValue', () => {
4444
});
4545

4646
it('fromJSON empty array does not throw', () => {
47-
const type = 'firestore/vectorvalue/1.0';
47+
const type = VectorValue._jsonSchemaVersion;
4848
const vectorValues = [1, 2, 3];
4949
expect(() => {
5050
VectorValue.fromJSON({ type, vectorValues });
5151
}).to.not.throw;
5252
});
5353

5454
it('fromJSON missing fields throws', () => {
55-
const type = 'firestore/vectorvalue/1.0';
55+
const type = VectorValue._jsonSchemaVersion;
5656
const vectorValues = [1, 2, 3];
5757
expect(() => {
5858
VectorValue.fromJSON({ type /* missing data */ });

0 commit comments

Comments
 (0)