Skip to content

Commit 9f62410

Browse files
authored
Implement PatchingDeletedDocumentsDoesNothing test (#2528)
...and add placeholders for numeric transform tests
1 parent 45d2fb2 commit 9f62410

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

Firestore/core/test/firebase/firestore/model/mutation_test.cc

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,13 +148,43 @@ TEST(Mutation, PatchesPrimitiveValue) {
148148
}
149149

150150
TEST(Mutation, PatchingDeletedDocumentsDoesNothing) {
151-
// TODO(rsgowman)
151+
auto base_doc =
152+
std::make_shared<NoDocument>(testutil::DeletedDoc("collection/key", 0));
153+
std::unique_ptr<Mutation> patch =
154+
PatchMutation("collection/key", {{"foo", FieldValue::FromString("bar")}});
155+
MaybeDocumentPtr patched_doc =
156+
patch->ApplyToLocalView(base_doc, base_doc.get(), Timestamp::Now());
157+
EXPECT_EQ(base_doc, patched_doc);
152158
}
153159

154160
TEST(Mutation, AppliesLocalServerTimestampTransformsToDocuments) {
155161
// TODO(rsgowman)
156162
}
157163

164+
TEST(Mutation, AppliesIncrementTransformToDocument) {
165+
// TODO(rsgowman)
166+
}
167+
168+
TEST(Mutation, AppliesIncrementTransformToUnexpectedType) {
169+
// TODO(rsgowman)
170+
}
171+
172+
TEST(Mutation, AppliesIncrementTransformToMissingField) {
173+
// TODO(rsgowman)
174+
}
175+
176+
TEST(Mutation, AppliesIncrementTransformsConsecutively) {
177+
// TODO(rsgowman)
178+
}
179+
180+
TEST(Mutation, AppliesIncrementWithoutOverflow) {
181+
// TODO(rsgowman)
182+
}
183+
184+
TEST(Mutation, AppliesIncrementWithoutUnderflow) {
185+
// TODO(rsgowman)
186+
}
187+
158188
TEST(Mutation, CreatesArrayUnionTransform) {
159189
// TODO(rsgowman)
160190
}

0 commit comments

Comments
 (0)