Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
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
2 changes: 0 additions & 2 deletions .surface
Original file line number Diff line number Diff line change
Expand Up @@ -1505,7 +1505,6 @@ FLAG basecamp checkins answer create --no-hints type=bool
FLAG basecamp checkins answer create --no-stats type=bool
FLAG basecamp checkins answer create --profile type=string
FLAG basecamp checkins answer create --project type=string
FLAG basecamp checkins answer create --question type=string
FLAG basecamp checkins answer create --questionnaire type=string
FLAG basecamp checkins answer create --quiet type=bool
FLAG basecamp checkins answer create --stats type=bool
Expand Down Expand Up @@ -6035,7 +6034,6 @@ FLAG basecamp webhooks create --stats type=bool
FLAG basecamp webhooks create --styled type=bool
FLAG basecamp webhooks create --todolist type=string
FLAG basecamp webhooks create --types type=string
FLAG basecamp webhooks create --url type=string
FLAG basecamp webhooks create --verbose type=count
FLAG basecamp webhooks delete --account type=string
FLAG basecamp webhooks delete --agent type=bool
Expand Down
4 changes: 4 additions & 0 deletions .surface-breaking
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FLAG basecamp checkin answer create --question type=string
FLAG basecamp checkins answer create --question type=string
FLAG basecamp webhook create --url type=string
FLAG basecamp webhooks create --url type=string
3 changes: 2 additions & 1 deletion e2e/boost.bats
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ load test_helper

run basecamp react "👍"
assert_failure
assert_output_contains "--on or --recording required"
assert_json_value '.error' '--on or --recording required'
assert_json_value '.code' 'usage'
}


Expand Down
10 changes: 5 additions & 5 deletions e2e/campfire.bats
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ load test_helper

run basecamp campfire post
assert_failure
assert_output_contains "Message content required"
assert_json_value '.error' '<message> required'
assert_json_value '.code' 'usage'
}


Expand Down Expand Up @@ -129,14 +130,13 @@ load test_helper

# Unknown action - Cobra treats unknown args as command arguments, not subcommands

@test "campfire unknown action shows error" {
@test "campfire unknown action shows help" {
create_credentials
create_global_config '{"account_id": 99999}'

run basecamp campfire foobar
# Cobra doesn't have a distinct "unknown subcommand" error for this pattern
# It falls through to the default behavior which requires a project
assert_failure
# Parent command with no RunE — cobra shows help for unknown subcommands
assert_success
}


Expand Down
37 changes: 22 additions & 15 deletions e2e/cards_columns_steps.bats
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,32 @@ load test_helper

# Card create tests

@test "card --help shows help with --content option" {
@test "card --help shows help with positional args" {
create_credentials
create_global_config '{"account_id": 99999}'

run basecamp card --help
assert_success
assert_output_contains "basecamp card"
assert_output_contains "--content"
assert_output_contains "--title"
assert_output_contains "<title>"
}

@test "card --content without value shows error" {
@test "card --content is not a valid flag" {
create_credentials
create_global_config '{"account_id": 99999, "project_id": 123}'

run basecamp card --title "Test" --content
# Content is now a positional arg, not a flag
run basecamp card "Test" --content
assert_failure
assert_output_contains "--content requires a value"
assert_output_contains "Unknown option"
}

@test "card with unknown option shows error" {
create_credentials
create_global_config '{"account_id": 99999, "project_id": 123}'

run basecamp card --title "Test" --foo
# Title is now positional, not --title
run basecamp card "Test" --foo
assert_failure
assert_output_contains "Unknown option: --foo"
}
Expand All @@ -39,9 +40,10 @@ load test_helper
create_credentials
create_global_config '{"account_id": 99999, "project_id": 123}'

run basecamp card --content "Body only"
run basecamp card
assert_failure
assert_output_contains "title required"
assert_json_value '.error' '<title> required'
assert_json_value '.code' 'usage'
}


Expand Down Expand Up @@ -74,7 +76,8 @@ load test_helper

run basecamp cards column create
assert_failure
assert_output_contains "title required"
assert_json_value '.error' '<title> required'
assert_json_value '.code' 'usage'
}


Expand Down Expand Up @@ -179,7 +182,8 @@ load test_helper

run basecamp cards column color 456
assert_failure
assert_output_contains "--color is required"
assert_json_value '.error' '--color required'
assert_json_value '.code' 'usage'
}


Expand Down Expand Up @@ -234,7 +238,7 @@ load test_helper

run basecamp cards steps
assert_failure
assert_output_contains "ID required"
assert_output_contains "required"
}

@test "cards steps without project shows error" {
Expand All @@ -255,7 +259,8 @@ load test_helper

run basecamp cards step create --card 456
assert_failure
assert_output_contains "title required"
assert_json_value '.error' '<title> required'
assert_json_value '.code' 'usage'
}

@test "cards step create without card shows error" {
Expand All @@ -277,7 +282,8 @@ load test_helper

run basecamp cards step update
assert_failure
assert_output_contains "ID required"
assert_json_value '.error' '<step_id|url> required'
assert_json_value '.code' 'usage'
}

@test "cards step update without fields shows error" {
Expand Down Expand Up @@ -328,7 +334,8 @@ load test_helper

run basecamp cards step move 456 --position 1
assert_failure
assert_output_contains "--card is required"
assert_json_value '.error' '--card required'
assert_json_value '.code' 'usage'
}

@test "cards step move without position shows error" {
Expand Down
12 changes: 7 additions & 5 deletions e2e/checkins.bats
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ load test_helper

# Missing context errors

@test "checkins without project shows error" {
@test "checkins without subcommand shows help" {
create_credentials
create_global_config '{"account_id": 99999}'

run basecamp checkins
assert_failure
assert_output_contains "project"
assert_success
assert_output_contains "COMMANDS"
}

@test "checkins questions without project shows error" {
Expand All @@ -51,7 +51,8 @@ load test_helper

run basecamp checkins question
assert_failure
assert_output_contains "ID required"
assert_json_value '.error' '<id|url> required'
assert_json_value '.code' 'usage'
}

@test "checkins answers without question id shows error" {
Expand All @@ -69,7 +70,8 @@ load test_helper

run basecamp checkins answer
assert_failure
assert_output_contains "Answer ID required"
assert_json_value '.error' '<id|url> required'
assert_json_value '.code' 'usage'
}


Expand Down
Loading
Loading