Skip to content

Commit 41505a7

Browse files
Port Test for increment with merge (#1547)
Ports tests from https://github.com/firebase/firebase-js-sdk/pull/3048/files
1 parent cf02ffc commit 41505a7

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

firebase-firestore/src/androidTest/java/com/google/firebase/firestore/NumericTransformsTest.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,14 @@ public void mergeOnNonExistingDocumentWithIncrement() {
9595
expectLocalAndRemoteValue(1337L);
9696
}
9797

98+
@Test
99+
public void mergeOnExistingDocumentWithIncrement() {
100+
waitFor(docRef.set(map("sum", 1)));
101+
expectLocalAndRemoteValue(1);
102+
waitFor(docRef.set(map("sum", FieldValue.increment(1337)), SetOptions.merge()));
103+
expectLocalAndRemoteValue(1338L);
104+
}
105+
98106
@Test
99107
public void integerIncrementWithExistingInteger() {
100108
writeInitialData(map("sum", 1337L));

0 commit comments

Comments
 (0)