Skip to content

Commit

Permalink
tests(firestore): additional tests for numeric where clauses (inverta…
Browse files Browse the repository at this point in the history
…se#3895)

* Added additional tests for numeric where clauses

* removed .only

Co-authored-by: Mike Diarmid <mike.diarmid@gmail.com>
  • Loading branch information
dackers86 and Salakar authored Jul 15, 2020
1 parent 6e33139 commit fdf1951
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions e2e/Query/where.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
});

0 comments on commit fdf1951

Please sign in to comment.