From 05dd4a8a3202e63fb19fedd9a418d53b4e75ca41 Mon Sep 17 00:00:00 2001 From: Daniel La Rocque Date: Thu, 26 Mar 2026 13:08:35 -0400 Subject: [PATCH] test(firestore): add test for union stage with user data There was a regression in the JS SDK: https://github.com/firebase/firebase-js-sdk/issues/9764 This adds a test that confirms a similar regression did not impact this SDK. --- .../firestore/dev/system-test/pipeline.ts | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/handwritten/firestore/dev/system-test/pipeline.ts b/handwritten/firestore/dev/system-test/pipeline.ts index 8377424c8d2..2937ce02e9b 100644 --- a/handwritten/firestore/dev/system-test/pipeline.ts +++ b/handwritten/firestore/dev/system-test/pipeline.ts @@ -2072,6 +2072,34 @@ describe.skipClassic('Pipeline class', () => { ); }); + it('run pipeline with user data with union', async () => { + const snapshot = await firestore + .pipeline() + .collection(randomCol.path) + .union( + firestore + .pipeline() + .collection(randomCol.path) + .where(equal('title', "The Hitchhiker's Guide to the Galaxy")), + ) + .sort(field(FieldPath.documentId()).ascending()) + .execute(); + expectResults( + snapshot, + 'book1', + 'book1', + 'book10', + 'book2', + 'book3', + 'book4', + 'book5', + 'book6', + 'book7', + 'book8', + 'book9', + ); + }); + it('supports options', async () => { const snapshot = await firestore .pipeline()