Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: Reverse position on explicit "must exist" for update #82

Merged
merged 1 commit into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 25 additions & 3 deletions firestore/v1/update-exists-precond.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,37 @@
{
"tests": [
{
"description": "update: Exists precondition is invalid",
"comment": "The Update method does not support an explicit exists precondition.",
"description": "update: Exists precondition is valid",
"comment": "The Update method supports an explicit exists precondition.",
"update": {
"docRefPath": "projects/projectID/databases/(default)/documents/C/d",
"precondition": {
"exists": true
},
"jsonData": "{\"a\": 1}",
"isError": true
"request": {
"database": "projects/projectID/databases/(default)",
"writes": [
{
"update": {
"name": "projects/projectID/databases/(default)/documents/C/d",
"fields": {
"a": {
"integerValue": "1"
}
}
},
"updateMask": {
"fieldPaths": [
"a"
]
},
"currentDocument": {
"exists": true
}
}
]
}
}
}
]
Expand Down
28 changes: 25 additions & 3 deletions firestore/v1/update-paths-exists-precond.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"tests": [
{
"description": "update-paths: Exists precondition is invalid",
"comment": "The Update method does not support an explicit exists precondition.",
"description": "update-paths: Exists precondition is valid",
"comment": "The Update method supports an explicit exists precondition.",
"updatePaths": {
"docRefPath": "projects/projectID/databases/(default)/documents/C/d",
"precondition": {
Expand All @@ -18,7 +18,29 @@
"jsonValues": [
"1"
],
"isError": true
"request": {
"database": "projects/projectID/databases/(default)",
"writes": [
{
"update": {
"name": "projects/projectID/databases/(default)/documents/C/d",
"fields": {
"a": {
"integerValue": "1"
}
}
},
"updateMask": {
"fieldPaths": [
"a"
]
},
"currentDocument": {
"exists": true
}
}
]
}
}
}
]
Expand Down