From 4f15c83ca581863260d3ff679af6ce7a533291c5 Mon Sep 17 00:00:00 2001 From: Darren Ackers Date: Wed, 15 Jul 2020 09:57:09 +0100 Subject: [PATCH] tests(firestore): additional tests for numeric where clauses (#3895) * Added additional tests for numeric where clauses * removed .only Co-authored-by: Mike Diarmid --- packages/firestore/e2e/Query/where.e2e.js | 28 +++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/packages/firestore/e2e/Query/where.e2e.js b/packages/firestore/e2e/Query/where.e2e.js index f18228e3..e6ab7c23 100644 --- a/packages/firestore/e2e/Query/where.e2e.js +++ b/packages/firestore/e2e/Query/where.e2e.js @@ -410,4 +410,32 @@ describe('firestore().collection().where()', () => { return Promise.resolve(); } }); + + it('should correctly query integer values with in operator', async () => { + const ref = firebase.firestore().collection('v6'); + + await ref.add({ status: 1 }); + + const items = []; + await ref + .where('status', 'in', [1, 2]) + .get() + .then($ => $.forEach(doc => items.push(doc.data()))); + + items.length.should.equal(1); + }); + + it('should correctly query integer values with array-contains operator', async () => { + const ref = firebase.firestore().collection('v6'); + + await ref.add({ status: [1, 2, 3] }); + + const items = []; + await ref + .where('status', 'array-contains', 2) + .get() + .then($ => $.forEach(doc => items.push(doc.data()))); + + items.length.should.equal(1); + }); });