Skip to content

Commit c8df3be

Browse files
committed
add test to the lite sdk test suite
1 parent dc583be commit c8df3be

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

packages/firestore/test/lite/integration.test.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,19 @@ describe('Transaction', () => {
524524
});
525525
});
526526

527+
it('can read deleted doc then write', () => {
528+
return withTestDocAndInitialData({ counter: 1 }, async doc => {
529+
await deleteDoc(doc);
530+
await runTransaction(doc.firestore, async transaction => {
531+
const snap = await transaction.get(doc);
532+
expect(snap.exists()).to.be.false;
533+
transaction.set(doc, { counter: 1 });
534+
});
535+
const result = await getDoc(doc);
536+
expect(result.get('counter')).to.equal(1);
537+
});
538+
});
539+
527540
it('retries when document is modified', () => {
528541
return withTestDoc(async doc => {
529542
let retryCounter = 0;

0 commit comments

Comments
 (0)