Skip to content

Commit 32ee331

Browse files
committed
Additional test cleanup
1 parent 3d6bbf3 commit 32ee331

File tree

2 files changed

+132
-136
lines changed

2 files changed

+132
-136
lines changed

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -2943,7 +2943,7 @@ apiDescribe('Pipelines', persistence => {
29432943
});
29442944
}
29452945

2946-
// sort on __name__ is not working
2946+
// sort on __name__ is not working, see b/409358591
29472947
itIf(testUnsupportedFeatures)(
29482948
'supports pagination with filters',
29492949
async () => {
@@ -2985,7 +2985,7 @@ apiDescribe('Pipelines', persistence => {
29852985
}
29862986
);
29872987

2988-
// sort on __name__ is not working
2988+
// sort on __name__ is not working, see b/409358591
29892989
itIf(testUnsupportedFeatures)(
29902990
'supports pagination with offsets',
29912991
async () => {

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

+130-134
Original file line numberDiff line numberDiff line change
@@ -247,143 +247,139 @@ apiDescribe('Query to Pipeline', persistence => {
247247
);
248248
});
249249

250-
it('supports startAfter (with DocumentSnapshot)',
251-
() => {
252-
return withTestCollection(
253-
PERSISTENCE_MODE_UNSPECIFIED,
254-
{
255-
1: { id: 1, foo: 1, bar: 1, baz: 1 },
256-
2: { id: 2, foo: 1, bar: 1, baz: 2 },
257-
3: { id: 3, foo: 1, bar: 1, baz: 2 },
258-
4: { id: 4, foo: 1, bar: 2, baz: 1 },
259-
5: { id: 5, foo: 1, bar: 2, baz: 2 },
260-
6: { id: 6, foo: 1, bar: 2, baz: 2 },
261-
7: { id: 7, foo: 2, bar: 1, baz: 1 },
262-
8: { id: 8, foo: 2, bar: 1, baz: 2 },
263-
9: { id: 9, foo: 2, bar: 1, baz: 2 },
264-
10: { id: 10, foo: 2, bar: 2, baz: 1 },
265-
11: { id: 11, foo: 2, bar: 2, baz: 2 },
266-
12: { id: 12, foo: 2, bar: 2, baz: 2 }
267-
},
268-
async (collRef, db) => {
269-
let docRef = await getDoc(doc(collRef, '2'));
270-
let query1 = query(
271-
collRef,
272-
orderBy('foo'),
273-
orderBy('bar'),
274-
orderBy('baz'),
275-
startAfter(docRef)
276-
);
277-
let snapshot = await execute(db.pipeline().createFrom(query1));
278-
verifyResults(
279-
snapshot,
280-
{ id: 3, foo: 1, bar: 1, baz: 2 },
281-
{ id: 4, foo: 1, bar: 2, baz: 1 },
282-
{ id: 5, foo: 1, bar: 2, baz: 2 },
283-
{ id: 6, foo: 1, bar: 2, baz: 2 },
284-
{ id: 7, foo: 2, bar: 1, baz: 1 },
285-
{ id: 8, foo: 2, bar: 1, baz: 2 },
286-
{ id: 9, foo: 2, bar: 1, baz: 2 },
287-
{ id: 10, foo: 2, bar: 2, baz: 1 },
288-
{ id: 11, foo: 2, bar: 2, baz: 2 },
289-
{ id: 12, foo: 2, bar: 2, baz: 2 }
290-
);
250+
it('supports startAfter (with DocumentSnapshot)', () => {
251+
return withTestCollection(
252+
PERSISTENCE_MODE_UNSPECIFIED,
253+
{
254+
1: { id: 1, foo: 1, bar: 1, baz: 1 },
255+
2: { id: 2, foo: 1, bar: 1, baz: 2 },
256+
3: { id: 3, foo: 1, bar: 1, baz: 2 },
257+
4: { id: 4, foo: 1, bar: 2, baz: 1 },
258+
5: { id: 5, foo: 1, bar: 2, baz: 2 },
259+
6: { id: 6, foo: 1, bar: 2, baz: 2 },
260+
7: { id: 7, foo: 2, bar: 1, baz: 1 },
261+
8: { id: 8, foo: 2, bar: 1, baz: 2 },
262+
9: { id: 9, foo: 2, bar: 1, baz: 2 },
263+
10: { id: 10, foo: 2, bar: 2, baz: 1 },
264+
11: { id: 11, foo: 2, bar: 2, baz: 2 },
265+
12: { id: 12, foo: 2, bar: 2, baz: 2 }
266+
},
267+
async (collRef, db) => {
268+
let docRef = await getDoc(doc(collRef, '2'));
269+
let query1 = query(
270+
collRef,
271+
orderBy('foo'),
272+
orderBy('bar'),
273+
orderBy('baz'),
274+
startAfter(docRef)
275+
);
276+
let snapshot = await execute(db.pipeline().createFrom(query1));
277+
verifyResults(
278+
snapshot,
279+
{ id: 3, foo: 1, bar: 1, baz: 2 },
280+
{ id: 4, foo: 1, bar: 2, baz: 1 },
281+
{ id: 5, foo: 1, bar: 2, baz: 2 },
282+
{ id: 6, foo: 1, bar: 2, baz: 2 },
283+
{ id: 7, foo: 2, bar: 1, baz: 1 },
284+
{ id: 8, foo: 2, bar: 1, baz: 2 },
285+
{ id: 9, foo: 2, bar: 1, baz: 2 },
286+
{ id: 10, foo: 2, bar: 2, baz: 1 },
287+
{ id: 11, foo: 2, bar: 2, baz: 2 },
288+
{ id: 12, foo: 2, bar: 2, baz: 2 }
289+
);
291290

292-
docRef = await getDoc(doc(collRef, '3'));
293-
query1 = query(
294-
collRef,
295-
orderBy('foo'),
296-
orderBy('bar'),
297-
orderBy('baz'),
298-
startAfter(docRef)
299-
);
300-
snapshot = await execute(db.pipeline().createFrom(query1));
301-
verifyResults(
302-
snapshot,
303-
{ id: 4, foo: 1, bar: 2, baz: 1 },
304-
{ id: 5, foo: 1, bar: 2, baz: 2 },
305-
{ id: 6, foo: 1, bar: 2, baz: 2 },
306-
{ id: 7, foo: 2, bar: 1, baz: 1 },
307-
{ id: 8, foo: 2, bar: 1, baz: 2 },
308-
{ id: 9, foo: 2, bar: 1, baz: 2 },
309-
{ id: 10, foo: 2, bar: 2, baz: 1 },
310-
{ id: 11, foo: 2, bar: 2, baz: 2 },
311-
{ id: 12, foo: 2, bar: 2, baz: 2 }
312-
);
313-
}
314-
);
315-
}
316-
);
291+
docRef = await getDoc(doc(collRef, '3'));
292+
query1 = query(
293+
collRef,
294+
orderBy('foo'),
295+
orderBy('bar'),
296+
orderBy('baz'),
297+
startAfter(docRef)
298+
);
299+
snapshot = await execute(db.pipeline().createFrom(query1));
300+
verifyResults(
301+
snapshot,
302+
{ id: 4, foo: 1, bar: 2, baz: 1 },
303+
{ id: 5, foo: 1, bar: 2, baz: 2 },
304+
{ id: 6, foo: 1, bar: 2, baz: 2 },
305+
{ id: 7, foo: 2, bar: 1, baz: 1 },
306+
{ id: 8, foo: 2, bar: 1, baz: 2 },
307+
{ id: 9, foo: 2, bar: 1, baz: 2 },
308+
{ id: 10, foo: 2, bar: 2, baz: 1 },
309+
{ id: 11, foo: 2, bar: 2, baz: 2 },
310+
{ id: 12, foo: 2, bar: 2, baz: 2 }
311+
);
312+
}
313+
);
314+
});
317315

318-
it('supports startAt (with DocumentSnapshot)',
319-
() => {
320-
return withTestCollection(
321-
PERSISTENCE_MODE_UNSPECIFIED,
322-
{
323-
1: { id: 1, foo: 1, bar: 1, baz: 1 },
324-
2: { id: 2, foo: 1, bar: 1, baz: 2 },
325-
3: { id: 3, foo: 1, bar: 1, baz: 2 },
326-
4: { id: 4, foo: 1, bar: 2, baz: 1 },
327-
5: { id: 5, foo: 1, bar: 2, baz: 2 },
328-
6: { id: 6, foo: 1, bar: 2, baz: 2 },
329-
7: { id: 7, foo: 2, bar: 1, baz: 1 },
330-
8: { id: 8, foo: 2, bar: 1, baz: 2 },
331-
9: { id: 9, foo: 2, bar: 1, baz: 2 },
332-
10: { id: 10, foo: 2, bar: 2, baz: 1 },
333-
11: { id: 11, foo: 2, bar: 2, baz: 2 },
334-
12: { id: 12, foo: 2, bar: 2, baz: 2 }
335-
},
336-
async (collRef, db) => {
337-
let docRef = await getDoc(doc(collRef, '2'));
338-
let query1 = query(
339-
collRef,
340-
orderBy('foo'),
341-
orderBy('bar'),
342-
orderBy('baz'),
343-
startAt(docRef)
344-
);
345-
let snapshot = await execute(db.pipeline().createFrom(query1));
346-
verifyResults(
347-
snapshot,
348-
{ id: 2, foo: 1, bar: 1, baz: 2 },
349-
{ id: 3, foo: 1, bar: 1, baz: 2 },
350-
{ id: 4, foo: 1, bar: 2, baz: 1 },
351-
{ id: 5, foo: 1, bar: 2, baz: 2 },
352-
{ id: 6, foo: 1, bar: 2, baz: 2 },
353-
{ id: 7, foo: 2, bar: 1, baz: 1 },
354-
{ id: 8, foo: 2, bar: 1, baz: 2 },
355-
{ id: 9, foo: 2, bar: 1, baz: 2 },
356-
{ id: 10, foo: 2, bar: 2, baz: 1 },
357-
{ id: 11, foo: 2, bar: 2, baz: 2 },
358-
{ id: 12, foo: 2, bar: 2, baz: 2 }
359-
);
316+
it('supports startAt (with DocumentSnapshot)', () => {
317+
return withTestCollection(
318+
PERSISTENCE_MODE_UNSPECIFIED,
319+
{
320+
1: { id: 1, foo: 1, bar: 1, baz: 1 },
321+
2: { id: 2, foo: 1, bar: 1, baz: 2 },
322+
3: { id: 3, foo: 1, bar: 1, baz: 2 },
323+
4: { id: 4, foo: 1, bar: 2, baz: 1 },
324+
5: { id: 5, foo: 1, bar: 2, baz: 2 },
325+
6: { id: 6, foo: 1, bar: 2, baz: 2 },
326+
7: { id: 7, foo: 2, bar: 1, baz: 1 },
327+
8: { id: 8, foo: 2, bar: 1, baz: 2 },
328+
9: { id: 9, foo: 2, bar: 1, baz: 2 },
329+
10: { id: 10, foo: 2, bar: 2, baz: 1 },
330+
11: { id: 11, foo: 2, bar: 2, baz: 2 },
331+
12: { id: 12, foo: 2, bar: 2, baz: 2 }
332+
},
333+
async (collRef, db) => {
334+
let docRef = await getDoc(doc(collRef, '2'));
335+
let query1 = query(
336+
collRef,
337+
orderBy('foo'),
338+
orderBy('bar'),
339+
orderBy('baz'),
340+
startAt(docRef)
341+
);
342+
let snapshot = await execute(db.pipeline().createFrom(query1));
343+
verifyResults(
344+
snapshot,
345+
{ id: 2, foo: 1, bar: 1, baz: 2 },
346+
{ id: 3, foo: 1, bar: 1, baz: 2 },
347+
{ id: 4, foo: 1, bar: 2, baz: 1 },
348+
{ id: 5, foo: 1, bar: 2, baz: 2 },
349+
{ id: 6, foo: 1, bar: 2, baz: 2 },
350+
{ id: 7, foo: 2, bar: 1, baz: 1 },
351+
{ id: 8, foo: 2, bar: 1, baz: 2 },
352+
{ id: 9, foo: 2, bar: 1, baz: 2 },
353+
{ id: 10, foo: 2, bar: 2, baz: 1 },
354+
{ id: 11, foo: 2, bar: 2, baz: 2 },
355+
{ id: 12, foo: 2, bar: 2, baz: 2 }
356+
);
360357

361-
docRef = await getDoc(doc(collRef, '3'));
362-
query1 = query(
363-
collRef,
364-
orderBy('foo'),
365-
orderBy('bar'),
366-
orderBy('baz'),
367-
startAt(docRef)
368-
);
369-
snapshot = await execute(db.pipeline().createFrom(query1));
370-
verifyResults(
371-
snapshot,
372-
{ id: 3, foo: 1, bar: 1, baz: 2 },
373-
{ id: 4, foo: 1, bar: 2, baz: 1 },
374-
{ id: 5, foo: 1, bar: 2, baz: 2 },
375-
{ id: 6, foo: 1, bar: 2, baz: 2 },
376-
{ id: 7, foo: 2, bar: 1, baz: 1 },
377-
{ id: 8, foo: 2, bar: 1, baz: 2 },
378-
{ id: 9, foo: 2, bar: 1, baz: 2 },
379-
{ id: 10, foo: 2, bar: 2, baz: 1 },
380-
{ id: 11, foo: 2, bar: 2, baz: 2 },
381-
{ id: 12, foo: 2, bar: 2, baz: 2 }
382-
);
383-
}
384-
);
385-
}
386-
);
358+
docRef = await getDoc(doc(collRef, '3'));
359+
query1 = query(
360+
collRef,
361+
orderBy('foo'),
362+
orderBy('bar'),
363+
orderBy('baz'),
364+
startAt(docRef)
365+
);
366+
snapshot = await execute(db.pipeline().createFrom(query1));
367+
verifyResults(
368+
snapshot,
369+
{ id: 3, foo: 1, bar: 1, baz: 2 },
370+
{ id: 4, foo: 1, bar: 2, baz: 1 },
371+
{ id: 5, foo: 1, bar: 2, baz: 2 },
372+
{ id: 6, foo: 1, bar: 2, baz: 2 },
373+
{ id: 7, foo: 2, bar: 1, baz: 1 },
374+
{ id: 8, foo: 2, bar: 1, baz: 2 },
375+
{ id: 9, foo: 2, bar: 1, baz: 2 },
376+
{ id: 10, foo: 2, bar: 2, baz: 1 },
377+
{ id: 11, foo: 2, bar: 2, baz: 2 },
378+
{ id: 12, foo: 2, bar: 2, baz: 2 }
379+
);
380+
}
381+
);
382+
});
387383

388384
it('supports startAfter', () => {
389385
return withTestCollection(

0 commit comments

Comments
 (0)