Skip to content

Commit

Permalink
test(GeoFirestoreQuery): add tests for _queryToString and `_stringT…
Browse files Browse the repository at this point in the history
…oQuery`
  • Loading branch information
MichaelSolati committed Aug 6, 2018
1 parent 12b10e5 commit 44677f0
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions test/query.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1755,4 +1755,26 @@ describe('GeoFirestoreQuery Tests:', () => {
}).catch(failTestOnCaughtError);
});
});

describe('Private functions', () => {
it('`_queryToString` throws error when not given an array of length 2', () => {
geoFirestoreQueries.push(geoFirestore.query({
center: new firebase.firestore.GeoPoint(1, 2),
radius: 1000
}));


expect(() => geoFirestoreQueries[0]['_queryToString']([])).to.throw();
});

it('`_stringToQuery` throws error when given invalid query string', () => {
geoFirestoreQueries.push(geoFirestore.query({
center: new firebase.firestore.GeoPoint(1, 2),
radius: 1000
}));


expect(() => geoFirestoreQueries[0]['_stringToQuery']('p129438tr')).to.throw();
});
});
});

0 comments on commit 44677f0

Please sign in to comment.