Skip to content
Merged
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
7 changes: 6 additions & 1 deletion src/chat_sdk/shared/mock_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,12 @@ def is_dm(self, thread_id: str) -> bool:
def get_channel_visibility(self, thread_id: str) -> ChannelVisibility:
return "unknown"

async def open_modal(self, **kwargs: Any) -> dict[str, str]:
async def open_modal(
self,
trigger_id: str = "",
modal: Any = None,
context_id: str | None = None,
) -> dict[str, str]:
Comment on lines +170 to +175
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The trigger_id and modal parameters should be required (without default values) to match the interface defined in BaseAdapter and implemented in SlackAdapter. Using default values in the mock can lead to tests passing even when required arguments are missing in the production code, which defeats the purpose of the mock in catching interface contract violations.

Suggested change
async def open_modal(
self,
trigger_id: str = "",
modal: Any = None,
context_id: str | None = None,
) -> dict[str, str]:
async def open_modal(
self,
trigger_id: str,
modal: Any,
context_id: str | None = None,
) -> dict[str, str]:

return {"view_id": "V123"}

async def fetch_channel_messages(self, channel_id: str, options: FetchOptions | None = None) -> FetchResult:
Expand Down
Loading