fix: MockAdapter.open_modal accepts positional args#28
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the open_modal method in MockAdapter to use explicit parameters instead of generic keyword arguments. The review feedback recommends removing the default values for trigger_id and modal to ensure the mock correctly enforces the interface contract and prevents tests from passing when required arguments are missing.
| async def open_modal( | ||
| self, | ||
| trigger_id: str = "", | ||
| modal: Any = None, | ||
| context_id: str | None = None, | ||
| ) -> dict[str, str]: |
There was a problem hiding this comment.
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.
| 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]: |
CI was failing because open_modal(**kwargs) doesn't accept 3 positional args.