Skip to content

Commit 3d6bbf3

Browse files
committed
Test fixes and re-enabling tests for features that were added on backend
1 parent 609d082 commit 3d6bbf3

File tree

3 files changed

+7
-39
lines changed

3 files changed

+7
-39
lines changed

packages/firestore/src/lite-api/expressions.ts

-10
Original file line numberDiff line numberDiff line change
@@ -3043,16 +3043,6 @@ export function arrayOffset(
30433043
return fieldOrExpression(array).arrayOffset(valueToDefaultExpr(offset));
30443044
}
30453045

3046-
/**
3047-
* @beta
3048-
* Creates an Expr that returns a map of all values in the current expression context.
3049-
*
3050-
* @return A new {@code Expr} representing the 'current_context' function.
3051-
*/
3052-
export function currentContext(): FunctionExpr {
3053-
return new FunctionExpr('current_context', []);
3054-
}
3055-
30563046
/**
30573047
* @beta
30583048
*

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

+3-20
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ use(chaiAsPromised);
144144

145145
setLogLevel('debug');
146146

147-
const testUnsupportedFeatures = false;
147+
const testUnsupportedFeatures: boolean | 'only' = false;
148148
const timestampDeltaMS = 1000;
149149

150150
apiDescribe('Pipelines', persistence => {
@@ -343,8 +343,7 @@ apiDescribe('Pipelines', persistence => {
343343
expect(snapshot.results.length).to.equal(0);
344344
});
345345

346-
// Skipping because __name__ is not currently working in DBE
347-
itIf(testUnsupportedFeatures)('full snapshot as expected', async () => {
346+
it('full snapshot as expected', async () => {
348347
const ppl = firestore
349348
.pipeline()
350349
.collection(randomCol.path)
@@ -1372,8 +1371,7 @@ apiDescribe('Pipelines', persistence => {
13721371
});
13731372

13741373
describe('union stage', () => {
1375-
// __name__ not currently supported by dbe
1376-
itIf(testUnsupportedFeatures)('run pipeline with union', async () => {
1374+
it('run pipeline with union', async () => {
13771375
const snapshot = await execute(
13781376
firestore
13791377
.pipeline()
@@ -2366,21 +2364,6 @@ apiDescribe('Pipelines', persistence => {
23662364
expectResults(snapshot, ...expectedResults);
23672365
});
23682366

2369-
// TODO: current_context tests with are failing because of b/395937453
2370-
itIf(testUnsupportedFeatures)('supports currentContext', async () => {
2371-
const snapshot = await execute(
2372-
firestore
2373-
.pipeline()
2374-
.collection(randomCol.path)
2375-
.sort(field('rating').descending())
2376-
.limit(1)
2377-
.select(currentContext().as('currentContext'))
2378-
);
2379-
expectResults(snapshot, {
2380-
currentContext: 'TODO'
2381-
});
2382-
});
2383-
23842367
it('supports map', async () => {
23852368
const snapshot = await execute(
23862369
firestore

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

+4-9
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ use(chaiAsPromised);
5555

5656
setLogLevel('debug');
5757

58-
const testUnsupportedFeatures = false;
58+
const testUnsupportedFeatures: boolean | 'only' = false;
5959

6060
// This is the Query integration tests from the lite API (no cache support)
6161
// with some additional test cases added for more complete coverage.
@@ -247,9 +247,7 @@ apiDescribe('Query to Pipeline', persistence => {
247247
);
248248
});
249249

250-
// sort on __name__ is not working
251-
itIf(testUnsupportedFeatures)(
252-
'supports startAfter (with DocumentSnapshot)',
250+
it('supports startAfter (with DocumentSnapshot)',
253251
() => {
254252
return withTestCollection(
255253
PERSISTENCE_MODE_UNSPECIFIED,
@@ -317,9 +315,7 @@ apiDescribe('Query to Pipeline', persistence => {
317315
}
318316
);
319317

320-
// sort on __name__ is not working
321-
itIf(testUnsupportedFeatures)(
322-
'supports startAt (with DocumentSnapshot)',
318+
it('supports startAt (with DocumentSnapshot)',
323319
() => {
324320
return withTestCollection(
325321
PERSISTENCE_MODE_UNSPECIFIED,
@@ -719,8 +715,7 @@ apiDescribe('Query to Pipeline', persistence => {
719715
);
720716
});
721717

722-
// sorting on name required
723-
itIf(testUnsupportedFeatures)('supports array contains any', () => {
718+
it('supports array contains any', () => {
724719
return withTestCollection(
725720
PERSISTENCE_MODE_UNSPECIFIED,
726721
{

0 commit comments

Comments
 (0)