Skip to content

Commit 86bea3c

Browse files
committed
Firestore: Remove obsolete special case from tests when verifying "missing index" error message from the backend.
1 parent 6ea51fb commit 86bea3c

File tree

2 files changed

+20
-54
lines changed

2 files changed

+20
-54
lines changed

packages/firestore/test/integration/api/aggregation.test.ts

Lines changed: 10 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -159,17 +159,9 @@ apiDescribe('Count queries', persistence => {
159159
where('key1', '==', 42),
160160
where('key2', '<', 42)
161161
);
162-
// TODO(b/316359394) Remove the special logic for non-default databases
163-
// once cl/582465034 is rolled out to production.
164-
if (coll.firestore._databaseId.isDefaultDatabase) {
165-
await expect(
166-
getCountFromServer(query_)
167-
).to.be.eventually.rejectedWith(
168-
/index.*https:\/\/console\.firebase\.google\.com/
169-
);
170-
} else {
171-
await expect(getCountFromServer(query_)).to.be.eventually.rejected;
172-
}
162+
await expect(getCountFromServer(query_)).to.be.eventually.rejectedWith(
163+
/index.*https:\/\/console\.firebase\.google\.com/
164+
);
173165
});
174166
}
175167
);
@@ -371,23 +363,13 @@ apiDescribe('Aggregation queries', persistence => {
371363
where('key1', '==', 42),
372364
where('key2', '<', 42)
373365
);
374-
// TODO(b/316359394) Remove the special logic for non-default databases
375-
// once cl/582465034 is rolled out to production.
376-
if (coll.firestore._databaseId.isDefaultDatabase) {
377-
await expect(
378-
getAggregateFromServer(query_, {
379-
count: count()
380-
})
381-
).to.be.eventually.rejectedWith(
382-
/index.*https:\/\/console\.firebase\.google\.com/
383-
);
384-
} else {
385-
await expect(
386-
getAggregateFromServer(query_, {
387-
count: count()
388-
})
389-
).to.be.eventually.rejected;
390-
}
366+
await expect(
367+
getAggregateFromServer(query_, {
368+
count: count()
369+
})
370+
).to.be.eventually.rejectedWith(
371+
/index.*https:\/\/console\.firebase\.google\.com/
372+
);
391373
});
392374
}
393375
);

packages/firestore/test/lite/integration.test.ts

Lines changed: 10 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2451,15 +2451,9 @@ describe('Count queries', () => {
24512451
where('key1', '==', 42),
24522452
where('key2', '<', 42)
24532453
);
2454-
// TODO(b/316359394) Remove the special logic for non-default databases
2455-
// once cl/582465034 is rolled out to production.
2456-
if (coll.firestore._databaseId.isDefaultDatabase) {
2457-
await expect(getCount(query_)).to.be.eventually.rejectedWith(
2458-
/index.*https:\/\/console\.firebase\.google\.com/
2459-
);
2460-
} else {
2461-
await expect(getCount(query_)).to.be.eventually.rejected;
2462-
}
2454+
await expect(getCount(query_)).to.be.eventually.rejectedWith(
2455+
/index.*https:\/\/console\.firebase\.google\.com/
2456+
);
24632457
});
24642458
}
24652459
);
@@ -2760,23 +2754,13 @@ describe('Aggregate queries', () => {
27602754
where('key1', '==', 42),
27612755
where('key2', '<', 42)
27622756
);
2763-
// TODO(b/316359394) Remove the special logic for non-default databases
2764-
// once cl/582465034 is rolled out to production.
2765-
if (coll.firestore._databaseId.isDefaultDatabase) {
2766-
await expect(
2767-
getAggregate(query_, {
2768-
myCount: count()
2769-
})
2770-
).to.be.eventually.rejectedWith(
2771-
/index.*https:\/\/console\.firebase\.google\.com/
2772-
);
2773-
} else {
2774-
await expect(
2775-
getAggregate(query_, {
2776-
myCount: count()
2777-
})
2778-
).to.be.eventually.rejected;
2779-
}
2757+
await expect(
2758+
getAggregate(query_, {
2759+
myCount: count()
2760+
})
2761+
).to.be.eventually.rejectedWith(
2762+
/index.*https:\/\/console\.firebase\.google\.com/
2763+
);
27802764
});
27812765
}
27822766
);

0 commit comments

Comments
 (0)