()
| 581 | |
| 582 | #[test] |
| 583 | fn test_parse_task_start() { |
| 584 | let hook = make_hook(); |
| 585 | let input = br#"{ |
| 586 | "taskId": "abc123", |
| 587 | "hookName": "TaskStart", |
| 588 | "timestamp": "1736654400000", |
| 589 | "workspaceRoots": ["/path/to/project"], |
| 590 | "model": {"provider": "openrouter", "slug": "anthropic/claude-sonnet-4.5"}, |
| 591 | "taskStart": {"task": "Add authentication to the API"} |
| 592 | }"#; |
| 593 | let event = hook.parse_event(HookType::SessionStart, input).unwrap(); |
| 594 | assert_eq!(event.session_id, "abc123"); |
| 595 | assert_eq!(event.event_type, HookType::SessionStart); |
| 596 | assert_eq!( |
| 597 | event.prompt.as_deref(), |
| 598 | Some("Add authentication to the API") |
| 599 | ); |
| 600 | } |
| 601 | |
| 602 | #[test] |
| 603 | fn test_parse_task_start_with_model_info() { |
nothing calls this directly
no test coverage detected