Skip to content

Commit 0a4a46a

Browse files
committed
Merge branch 'mila/count' into mila/count-non-lite-api-tests
2 parents 889e81f + 507e984 commit 0a4a46a

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import {
2222
collectionGroup,
2323
countQuery,
2424
doc,
25+
disableNetwork,
2526
getAggregateFromServerDirect,
2627
query,
2728
terminate,
@@ -119,4 +120,19 @@ apiDescribe('Aggregation query', (persistence: boolean) => {
119120
await terminate(firestore);
120121
});
121122
});
123+
124+
it('getAggregateFromServerDirect fails if user is offline', () => {
125+
return withEmptyTestCollection(
126+
persistence,
127+
async (collection, firestore) => {
128+
await disableNetwork(firestore);
129+
const countQuery_ = countQuery(collection);
130+
await expect(
131+
getAggregateFromServerDirect(countQuery_)
132+
).to.be.eventually.rejectedWith(
133+
'Failed to get aggregate result because the client is offline'
134+
);
135+
}
136+
);
137+
});
122138
});

0 commit comments

Comments
 (0)