# Tests Directory This directory contains test scripts for verifying NixOS configurations. ## Purpose Automated verification of system configurations to catch issues before deployment. ## Available Tests ### Firefox Configuration Test **Script:** `test-firefox-config.sh` Verifies Firefox Home Manager configuration for user `jsutter`: - Environment variables (`MOZ_USE_XINPUT2`) - Policy file existence and validity - Extension policies - Profile preferences - Privacy settings **Usage:** ```bash ./test-firefox-config.sh ``` **Requirements:** - Firefox installed - Valid Home Manager configuration - JSON parsing tool (`jq` or Python) ## Running Tests ### All Tests ```bash tests/test-firefox-config.sh ``` ### Specific Test ```bash ./tests/test-firefox-config.sh ``` ## Test Conventions ### Shell Scripts - Use `set -e` for error handling - Define colored output for readability - Track pass/fail/skip counts - Return non-zero on failure - Use helper functions (`print_pass`, `print_fail`, etc.) ### Test Coverage Tests should verify: - Configuration builds successfully - Policies are active (`about:policies`) - Settings are enforced - Extensions are force-installed - User preferences are applied ## Adding New Tests 1. Create test script in `tests/` 2. Make executable: `chmod +x tests/new-test.sh` 3. Document in this README 4. Follow naming convention: `test-.sh` ## Notes - Many tests require services to be deployed first - Some Firefox tests require Firefox to have been run once - Automated tests complement manual verification - Update test scripts when configurations change ## Related Documentation - `context/` - Configuration documentation - `agents.md` - Agent procedures