(t *testing.T)
| 267 | } |
| 268 | |
| 269 | func TestHandleUnknownMessageType(t *testing.T) { |
| 270 | app, err := NewApp(&AppConfig{ |
| 271 | Framework: FrameworkWails, |
| 272 | }) |
| 273 | if err != nil { |
| 274 | t.Fatalf("NewApp() error = %v", err) |
| 275 | } |
| 276 | |
| 277 | resp, err := app.handleMessage(&FrontendMessage{ |
| 278 | ID: "test-1", |
| 279 | Type: MessageType("unknown"), |
| 280 | }) |
| 281 | |
| 282 | if err != nil { |
| 283 | t.Errorf("unexpected error: %v", err) |
| 284 | } |
| 285 | if resp.Success { |
| 286 | t.Error("expected failure for unknown message type") |
| 287 | } |
| 288 | if !strings.Contains(resp.Error, "unknown message type") { |
| 289 | t.Errorf("error = %s, want to contain 'unknown message type'", resp.Error) |
| 290 | } |
| 291 | } |
| 292 | |
| 293 | func TestTauriBridgePort(t *testing.T) { |
| 294 | app, err := NewApp(&AppConfig{ |
nothing calls this directly
no test coverage detected