Skip to content

Commit

Permalink
test(firestore): re-enable modular where-in test via stable ordering
Browse files Browse the repository at this point in the history
the test was working just the order of returned data wasn't stable vs
assertion expectations of stability, so added an orderBy clause
  • Loading branch information
mikehardy committed Sep 20, 2023
1 parent daa4279 commit fa7424d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/firestore/e2e/Query/where.and.filter.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -1213,9 +1213,9 @@ describe(' firestore().collection().where(AND Filters)', function () {
});

// FIXME: Works in isolation, but fails in suite
xit('returns with where "in" filter', async function () {
const { getFirestore, collection, addDoc, getDocs, query, where } = firestoreModular;
const colRef = collection(getFirestore(), `${COLLECTION}/filter/in-modular`);
it('returns with where "in" filter', async function () {
const { getFirestore, collection, addDoc, getDocs, query, where, orderBy } = firestoreModular;
const colRef = collection(getFirestore(), `${COLLECTION}/filter/where-in-modular`);
const expected1 = 'bar';
const expected2 = 'baz';
const data1 = { foo: expected1 };
Expand All @@ -1228,7 +1228,9 @@ describe(' firestore().collection().where(AND Filters)', function () {
addDoc(colRef, data2),
]);

const snapshot = await getDocs(query(colRef, where('foo', 'in', [expected1, expected2])));
const snapshot = await getDocs(
query(colRef, where('foo', 'in', [expected1, expected2]), orderBy('foo')),
);

snapshot.size.should.eql(2);
snapshot.docs[0].data().foo.should.eql(expected1);
Expand Down

0 comments on commit fa7424d

Please sign in to comment.