Skip to content

test(client): cover actions.rs translation logic#483

Merged
intendednull merged 1 commit into
claude/friendly-maxwell-bVlpWfrom
auto-fix/issue-420-actions-tests
Apr 28, 2026
Merged

test(client): cover actions.rs translation logic#483
intendednull merged 1 commit into
claude/friendly-maxwell-bVlpWfrom
auto-fix/issue-420-actions-tests

Conversation

@intendednull
Copy link
Copy Markdown
Owner

Adds client-tier tests for the methods in crates/client/src/actions.rs that do real translation work before delegating to the mutation handle. Pure pass-throughs are documented at the module level rather than re-tested.

Tests added (7)

  • share_file_inline_rejects_oversized_payload — 256 KiB cap branch.
  • share_file_inline_emits_base64_encoded_body[file:NAME:BASE64] body shape + round-trip.
  • create_voice_channel_records_voice_kind — UUID minting + ChannelKind::Voice materializes.
  • set_permission_grants_then_revokes_on_role — both granted=true and granted=false branches.
  • assign_role_adds_role_to_member — role id lands on the member's role set.
  • pinned_message_ids_empty_for_unknown_channel — name-lookup fallback returns empty rather than panicking.
  • pin_message_flows_through_pinned_views — pin lifecycle composition through pinned_message_ids, pinned_messages, is_pinned, then unpin.

Pass-throughs documented (not re-tested)

send_message, send_reply, edit_message, delete_message, react, pin_message, unpin_message, create_channel, create_ephemeral_channel, revive_channel, delete_channel, propose_grant_admin, propose_revoke_admin, propose_kick_member, create_role, delete_role, switch_channel, mutate_channel_mute, mutate_grove_mute — covered through the mutation handle in tests/multi_peer_sync.rs, tests/trust_flow.rs, the inline tests block in lib.rs, and the state-machine tests.

Test plan

  • cargo fmt --all -- --check
  • cargo clippy -p willow-client --all-targets -- -D warnings
  • cargo test -p willow-client — 294 passed (was 287, +7 new)
  • cargo check -p willow-client --target wasm32-unknown-unknown

Refs #420


Generated by Claude Code

Adds 7 client-tier tests for the methods in `actions.rs` that do real
translation work before delegating: `share_file_inline` (size cap +
body shape), `create_voice_channel` (UUID + Voice kind),
`set_permission` (grant + revoke branches), `assign_role`, and the
`pinned_message_ids` / `pinned_messages` / `is_pinned` derived-view
chain (including unknown-channel fallback).

Pure pass-throughs (`send_message`, `create_channel`,
`propose_revoke_admin`, etc.) are documented as such in a new
module-level doc comment on `actions.rs` and intentionally not
re-tested here — their behaviour is covered through the mutation
handle in `tests/multi_peer_sync.rs`, `tests/trust_flow.rs`, and the
state-machine tests.

Refs #420
@intendednull intendednull merged commit 04b2b93 into claude/friendly-maxwell-bVlpW Apr 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants