tests(firestore): additional tests for numeric where clauses (#3895)

* Added additional tests for numeric where clauses

* removed .only

Co-authored-by: Mike Diarmid <mike.diarmid@gmail.com>
This commit is contained in:
Darren Ackers
2020-07-15 09:57:09 +01:00
committed by GitHub
parent 352f58b772
commit 4f15c83ca5

View File

@@ -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);
});
});