| 348 | |
| 349 | #[test] |
| 350 | fn test_disable_roundtrip() { |
| 351 | let dir = tempfile::TempDir::new().unwrap(); |
| 352 | std::fs::create_dir_all(dir.path().join(".atomic")).unwrap(); |
| 353 | std::fs::create_dir_all(dir.path().join(".claude")).unwrap(); |
| 354 | |
| 355 | let registry = AgentRegistry::with_defaults(); |
| 356 | let agent = registry.get("claude-code").unwrap(); |
| 357 | |
| 358 | // Install hooks first |
| 359 | let count = agent.install(dir.path()).unwrap(); |
| 360 | assert_eq!(count, 8); |
| 361 | assert!(agent.is_installed(dir.path())); |
| 362 | |
| 363 | // Uninstall |
| 364 | agent.uninstall(dir.path()).unwrap(); |
| 365 | assert!(!agent.is_installed(dir.path())); |
| 366 | |
| 367 | // Settings file should still exist (with non-Atomic content or empty hooks) |
| 368 | let settings_path = dir.path().join(".claude").join("settings.json"); |
| 369 | assert!(settings_path.exists()); |
| 370 | |
| 371 | // Verify no Atomic hooks remain |
| 372 | let content = std::fs::read_to_string(&settings_path).unwrap(); |
| 373 | assert!(!content.contains("atomic agent hooks")); |
| 374 | } |
| 375 | |
| 376 | #[test] |
| 377 | fn test_disable_preserves_non_atomic_hooks() { |