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

test: add tests for update with exists=false precondition #84

Merged
merged 3 commits into from
Jan 23, 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
16 changes: 16 additions & 0 deletions firestore/v1/update-exists-false-precond.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"tests": [
{
"description": "update: Exists=false precondition is invalid",
"comment": "The Update method does not support an explicit exists=false precondition.",
"update": {
"docRefPath": "projects/projectID/databases/(default)/documents/C/d",
"precondition": {
"exists": false
},
"jsonData": "{\"a\": 1}",
"isError": true
}
}
]
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"tests": [
{
"description": "update: Exists precondition is valid",
"comment": "The Update method supports an explicit exists precondition.",
"description": "update: Exists=true precondition is valid",
"comment": "The Update method supports an explicit exists=true precondition.",
"update": {
"docRefPath": "projects/projectID/databases/(default)/documents/C/d",
"precondition": {
Expand Down
25 changes: 25 additions & 0 deletions firestore/v1/update-paths-exists-false-precond.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"tests": [
{
"description": "update-paths: Exists=false precondition is invalid",
"comment": "The Update method does not support an explicit exists=false precondition.",
"updatePaths": {
"docRefPath": "projects/projectID/databases/(default)/documents/C/d",
"precondition": {
"exists": false
},
"fieldPaths": [
{
"field": [
"a"
]
}
],
"jsonValues": [
"1"
],
"isError": true
}
}
]
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"tests": [
{
"description": "update-paths: Exists precondition is valid",
"comment": "The Update method supports an explicit exists precondition.",
"description": "update-paths: Exists=true precondition is valid",
"comment": "The Update method supports an explicit exists=true precondition.",
"updatePaths": {
"docRefPath": "projects/projectID/databases/(default)/documents/C/d",
"precondition": {
Expand Down