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