(self)
| 138 | class TestHandleBrowserMessage: |
| 139 | @pytest.mark.asyncio |
| 140 | async def test_calls_callback(self): |
| 141 | from mcp_cli.dashboard.server import DashboardServer |
| 142 | |
| 143 | s = DashboardServer() |
| 144 | received = [] |
| 145 | |
| 146 | async def handler(msg): |
| 147 | received.append(msg) |
| 148 | |
| 149 | s.on_browser_message = handler |
| 150 | await s._handle_browser_message('{"type":"USER_MESSAGE","content":"hi"}') |
| 151 | assert received == [{"type": "USER_MESSAGE", "content": "hi"}] |
| 152 | |
| 153 | @pytest.mark.asyncio |
| 154 | async def test_invalid_json_ignored(self): |
nothing calls this directly
no test coverage detected