| 450 | |
| 451 | #[test] |
| 452 | fn test_disable_roundtrip() { |
| 453 | let dir = tempfile::TempDir::new().unwrap(); |
| 454 | std::fs::create_dir_all(dir.path().join(".atomic")).unwrap(); |
| 455 | std::fs::create_dir_all(dir.path().join(".claude")).unwrap(); |
| 456 | |
| 457 | let registry = AgentRegistry::with_defaults(); |
| 458 | let agent = registry.get("claude-code").unwrap(); |
| 459 | |
| 460 | // Install hooks first |
| 461 | let count = agent.install(dir.path()).unwrap(); |
| 462 | assert_eq!(count, 8); |
| 463 | assert!(agent.is_installed(dir.path())); |
| 464 | |
| 465 | // Uninstall |
| 466 | agent.uninstall(dir.path()).unwrap(); |
| 467 | assert!(!agent.is_installed(dir.path())); |
| 468 | |
| 469 | // Settings file should still exist (with non-Atomic content or empty hooks) |
| 470 | let settings_path = dir.path().join(".claude").join("settings.json"); |
| 471 | assert!(settings_path.exists()); |
| 472 | |
| 473 | // Verify no Atomic hooks remain |
| 474 | let content = std::fs::read_to_string(&settings_path).unwrap(); |
| 475 | assert!(!content.contains("atomic agent hooks")); |
| 476 | } |
| 477 | |
| 478 | #[test] |
| 479 | fn test_disable_preserves_non_atomic_hooks() { |