Skip to content

Commit c0bf4da

Browse files
committed
Merge branch 'main' into mila/ifnull_coalesce
2 parents 9e1a97e + 742e17a commit c0bf4da

2 files changed

Lines changed: 100 additions & 81 deletions

File tree

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

Lines changed: 50 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -2351,10 +2351,13 @@ apiDescribe.skipClassic('Pipelines', persistence => {
23512351
const err = e as FirebaseError;
23522352
expect(err['code']).to.equal('invalid-argument');
23532353
expect(typeof err['message']).to.equal('string');
2354+
2355+
expect(err['message']).to.match(
2356+
/Expected fields to be MAP_VALUE, but was FIELD_REFERENCE_VALUE./
2357+
);
23542358
}
23552359
});
23562360
});
2357-
23582361
describe('function expressions', () => {
23592362
it('logical max works', async () => {
23602363
const snapshot = await execute(
@@ -2364,17 +2367,17 @@ apiDescribe.skipClassic('Pipelines', persistence => {
23642367
.select(
23652368
'title',
23662369
logicalMaximum(constant(1960), field('published'), 1961).as(
2367-
'published-safe'
2370+
'publishedSafe'
23682371
)
23692372
)
23702373
.sort(field('title').ascending())
23712374
.limit(3)
23722375
);
23732376
expectResults(
23742377
snapshot,
2375-
{ title: '1984', 'published-safe': 1961 },
2376-
{ title: 'Crime and Punishment', 'published-safe': 1961 },
2377-
{ title: 'Dune', 'published-safe': 1965 }
2378+
{ title: '1984', 'publishedSafe': 1961 },
2379+
{ title: 'Crime and Punishment', 'publishedSafe': 1961 },
2380+
{ title: 'Dune', 'publishedSafe': 1965 }
23782381
);
23792382
});
23802383

@@ -2386,17 +2389,17 @@ apiDescribe.skipClassic('Pipelines', persistence => {
23862389
.select(
23872390
'title',
23882391
logicalMinimum(constant(1960), field('published'), 1961).as(
2389-
'published-safe'
2392+
'publishedSafe'
23902393
)
23912394
)
23922395
.sort(field('title').ascending())
23932396
.limit(3)
23942397
);
23952398
expectResults(
23962399
snapshot,
2397-
{ title: '1984', 'published-safe': 1949 },
2398-
{ title: 'Crime and Punishment', 'published-safe': 1866 },
2399-
{ title: 'Dune', 'published-safe': 1960 }
2400+
{ title: '1984', 'publishedSafe': 1949 },
2401+
{ title: 'Crime and Punishment', 'publishedSafe': 1866 },
2402+
{ title: 'Dune', 'publishedSafe': 1960 }
24002403
);
24012404
});
24022405

@@ -2411,7 +2414,7 @@ apiDescribe.skipClassic('Pipelines', persistence => {
24112414
lessThan(field('published'), 1960),
24122415
constant(1960),
24132416
field('published')
2414-
).as('published-safe'),
2417+
).as('publishedSafe'),
24152418
field('rating')
24162419
.greaterThanOrEqual(4.5)
24172420
.conditional(constant('great'), constant('good'))
@@ -2422,13 +2425,13 @@ apiDescribe.skipClassic('Pipelines', persistence => {
24222425
);
24232426
expectResults(
24242427
snapshot,
2425-
{ title: '1984', 'published-safe': 1960, rating: 'good' },
2428+
{ title: '1984', 'publishedSafe': 1960, rating: 'good' },
24262429
{
24272430
title: 'Crime and Punishment',
2428-
'published-safe': 1960,
2431+
'publishedSafe': 1960,
24292432
rating: 'good'
24302433
},
2431-
{ title: 'Dune', 'published-safe': 1965, rating: 'great' }
2434+
{ title: 'Dune', 'publishedSafe': 1965, rating: 'great' }
24322435
);
24332436
});
24342437

@@ -2937,9 +2940,11 @@ apiDescribe.skipClassic('Pipelines', persistence => {
29372940
snapshot,
29382941
{
29392942
title: "The Hitchhiker's Guide to the Galaxy",
2940-
'awards.hugo': true
2943+
awards: {
2944+
hugo: true
2945+
}
29412946
},
2942-
{ title: 'Dune', 'awards.hugo': true }
2947+
{ title: 'Dune', awards: { hugo: true } }
29432948
);
29442949
});
29452950

@@ -2952,7 +2957,7 @@ apiDescribe.skipClassic('Pipelines', persistence => {
29522957
.replaceWith(
29532958
map({
29542959
title: 'foo',
2955-
nested: {
2960+
nestedField: {
29562961
level: {
29572962
'1': 'bar'
29582963
},
@@ -2964,13 +2969,17 @@ apiDescribe.skipClassic('Pipelines', persistence => {
29642969
)
29652970
.select(
29662971
'title',
2967-
field('nested.level.1'),
2968-
mapGet('nested', 'level.1').mapGet('level.2').as('nested')
2972+
field('nestedField.level.1'),
2973+
mapGet('nestedField', 'level.1').mapGet('level.2').as('nested')
29692974
)
29702975
);
29712976
expectResults(snapshot, {
29722977
title: 'foo',
2973-
'nested.level.`1`': 'bar',
2978+
nestedField: {
2979+
level: {
2980+
'1': 'bar'
2981+
}
2982+
},
29742983
nested: 'baz'
29752984
});
29762985
});
@@ -4280,17 +4289,17 @@ apiDescribe.skipClassic('Pipelines', persistence => {
42804289
})
42814290
)
42824291
.select(
4283-
field('foo').round(0).as('0'),
4284-
round('foo', 1).as('1'),
4285-
round('foo', constant(2)).as('2'),
4286-
round(field('foo'), 4).as('4')
4292+
field('foo').round(0).as('roundedTo0'),
4293+
round('foo', 1).as('roundedTo1'),
4294+
round('foo', constant(2)).as('roundedTo2'),
4295+
round(field('foo'), 4).as('roundedTo4')
42874296
)
42884297
);
42894298
expectResults(snapshot, {
4290-
'0': 4,
4291-
'1': 4.1,
4292-
'2': 4.12,
4293-
'4': 4.1235
4299+
roundedTo0: 4,
4300+
roundedTo1: 4.1,
4301+
roundedTo2: 4.12,
4302+
roundedTo4: 4.1235
42944303
});
42954304
});
42964305

@@ -4334,17 +4343,17 @@ apiDescribe.skipClassic('Pipelines', persistence => {
43344343
})
43354344
)
43364345
.select(
4337-
field('foo').trunc(0).as('0'),
4338-
trunc('foo', 1).as('1'),
4339-
trunc('foo', constant(2)).as('2'),
4340-
trunc(field('foo'), 4).as('4')
4346+
field('foo').trunc(0).as('truncatedTo0'),
4347+
trunc('foo', 1).as('truncatedTo1'),
4348+
trunc('foo', constant(2)).as('truncatedTo2'),
4349+
trunc(field('foo'), 4).as('truncatedTo4')
43414350
)
43424351
);
43434352
expectResults(snapshot, {
4344-
'0': 4,
4345-
'1': 4.1,
4346-
'2': 4.12,
4347-
'4': 4.1234
4353+
truncatedTo0: 4,
4354+
truncatedTo1: 4.1,
4355+
truncatedTo2: 4.12,
4356+
truncatedTo4: 4.1234
43484357
});
43494358
});
43504359

@@ -4968,15 +4977,15 @@ apiDescribe.skipClassic('Pipelines', persistence => {
49684977
constant(1).as('pos1')
49694978
)
49704979
.select(
4971-
abs('neg10').as('10'),
4972-
abs(field('neg22')).as('22'),
4973-
field('pos1').as('1')
4980+
abs('neg10').as('abs10'),
4981+
abs(field('neg22')).as('abs22'),
4982+
field('pos1').as('abs1')
49744983
)
49754984
);
49764985
expectResults(snapshot, {
4977-
'10': 10,
4978-
'22': 22.22,
4979-
'1': 1
4986+
'abs10': 10,
4987+
'abs22': 22.22,
4988+
'abs1': 1
49804989
});
49814990
});
49824991

0 commit comments

Comments
 (0)