Repository navigation
Add and change cloud files and Google documents in Docs & Files #1012
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
Open
jeremy
wants to merge
9
commits into
main
Choose a base branch
from
sdk-absorb/card-10476950575
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
ac407b1
Add and change cloud files and Google documents in Docs & Files
jeremy 9cae368
Check a pasted URL and upload local images in cloud file and Google d…
jeremy e862ef6
Test that a local image in a Google document's description is uploaded
jeremy cb8d8fa
Point cloud file and Google document hints at IDs that exist, and kee…
jeremy 2c6af3c
Merge remote-tracking branch 'origin/main' into sdk-absorb/card-10476…
jeremy 2c299d6
Merge remote-tracking branch 'origin/main' into sdk-absorb/card-10476…
jeremy a5aa00f
Merge main into sdk-absorb/card-10476950575
jeremy a745c98
Merge main into sdk-absorb/card-10476950575
jeremy c742d62
Refuse a comment's permalink in cloud-files and google-docs update
jeremy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| #!/usr/bin/env bats | ||
| # smoke_file_links.bats - Level 1: Cloud files and Google documents in Docs & Files | ||
|
|
||
| load smoke_helper | ||
|
|
||
| setup_file() { | ||
| # Each update reads the id its create wrote. | ||
| export BATS_NO_PARALLELIZE_WITHIN_FILE=true | ||
| ensure_token || return 1 | ||
| ensure_project || return 1 | ||
| } | ||
|
|
||
| @test "files cloud-files create adds a cloud file" { | ||
|
jeremy marked this conversation as resolved.
Resolved
|
||
| run_smoke basecamp files cloud-files create "Smoke cloud file" \ | ||
| --url "https://example.com/smoke-$(date +%s)" --description "Kept" \ | ||
| --no-subscribe -p "$QA_PROJECT" --json | ||
| assert_success | ||
| assert_json_value '.ok' 'true' | ||
| assert_json_value '.data.service.code' 'other' | ||
|
|
||
| echo "$output" | jq -r '.data.id' > "$BATS_FILE_TMPDIR/cloud_file_id" | ||
| } | ||
|
|
||
| @test "files cloud-files update renames a cloud file and keeps the rest" { | ||
| local id_file="$BATS_FILE_TMPDIR/cloud_file_id" | ||
| [[ -f "$id_file" ]] || mark_unverifiable "No cloud file created in prior test" | ||
| local cloud_file_id | ||
| cloud_file_id=$(<"$id_file") | ||
|
|
||
| run_smoke basecamp files cloud-files update "$cloud_file_id" --title "Smoke cloud file renamed" --json | ||
| assert_success | ||
| assert_json_value '.data.title' 'Smoke cloud file renamed' | ||
| assert_json_value '.data.service.code' 'other' | ||
| assert_json_value '.data.description | contains("Kept")' 'true' | ||
| } | ||
|
|
||
| @test "files google-docs create adds a Google document" { | ||
| run_smoke basecamp files google-docs create "Smoke Google doc" \ | ||
| --url "https://docs.google.com/document/d/smoke-$(date +%s)/edit" \ | ||
| --draft --no-subscribe -p "$QA_PROJECT" --json | ||
| assert_success | ||
| assert_json_value '.ok' 'true' | ||
| assert_json_value '.data.document_type' 'doc' | ||
| assert_json_value '.data.status' 'drafted' | ||
|
|
||
| echo "$output" | jq -r '.data.id' > "$BATS_FILE_TMPDIR/google_doc_id" | ||
| } | ||
|
|
||
| @test "files google-docs update renames a Google document and keeps it a draft" { | ||
| local id_file="$BATS_FILE_TMPDIR/google_doc_id" | ||
| [[ -f "$id_file" ]] || mark_unverifiable "No Google document created in prior test" | ||
| local google_doc_id | ||
| google_doc_id=$(<"$id_file") | ||
|
|
||
| run_smoke basecamp files google-docs update "$google_doc_id" --title "Smoke Google doc renamed" --json | ||
| assert_success | ||
| assert_json_value '.data.title' 'Smoke Google doc renamed' | ||
| assert_json_value '.data.document_type' 'doc' | ||
| assert_json_value '.data.status' 'drafted' | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.