MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / test_disable_roundtrip

Function test_disable_roundtrip

atomic-cli/src/commands/agent/disable.rs:355–379  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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() {

Callers

nothing calls this directly

Calls 5

getMethod · 0.65
unwrapMethod · 0.45
pathMethod · 0.45
installMethod · 0.45
uninstallMethod · 0.45

Tested by

no test coverage detected