Skip to content

Commit e1d37ef

Browse files
author
Brian Chen
authored
Add test for != document ID (#3597)
1 parent d4ca3da commit e1d37ef

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

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

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -748,6 +748,30 @@ apiDescribe('Queries', (persistence: boolean) => {
748748
}
749749
);
750750

751+
// eslint-disable-next-line no-restricted-properties
752+
(isRunningAgainstEmulator() ? it : it.skip)(
753+
'can use != filters by document ID',
754+
async () => {
755+
const testDocs = {
756+
aa: { key: 'aa' },
757+
ab: { key: 'ab' },
758+
ba: { key: 'ba' },
759+
bb: { key: 'bb' }
760+
};
761+
await withTestCollection(persistence, testDocs, async coll => {
762+
const snapshot = await coll
763+
.where(FieldPath.documentId(), notEqualOp, 'aa')
764+
.get();
765+
766+
expect(toDataArray(snapshot)).to.deep.equal([
767+
{ key: 'ab' },
768+
{ key: 'ba' },
769+
{ key: 'bb' }
770+
]);
771+
});
772+
}
773+
);
774+
751775
it('can use array-contains filters', async () => {
752776
const testDocs = {
753777
a: { array: [42] },

0 commit comments

Comments
 (0)