1
0
forked from icd/rentgen

9 Commits

Author SHA1 Message Date
9565f25a5d refactor: move code quality checks to tests/run-checks.sh script 2025-10-27 21:00:58 +00:00
865504ed6a fix: modify manifest.json during build to inject test content script 2025-10-27 20:40:45 +00:00
7513594b00 refactor: replace math test with practical badge count test
Changed test from artificial computation ((17*2)+3=37) to real-world
functionality testing: counting third-party domains shown in badge.

Test flow:
1. Visit news.ycombinator.com → verify badge = 0 (no trackers)
2. Visit pudelek.pl → verify badge > 0 (has trackers)

Changes:
- background.ts: handler returns badgeCount from getClustersForOrigin()
- test-content-script.js: sends origin, stores badgeCount in DOM
- test-lib.js: testBadgeCount() replaces testBackgroundComputation()
- test_verify.py: tests two real sites instead of math computation

This tests actual Rentgen functionality: third-party domain detection.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-27 20:06:05 +00:00
9abc406d4a Revert "test: add verification script for ENABLE_TESTS mechanism"
This reverts commit 655b3b01ff9fa61fdb0e6eabedd07d02591f9dbb.
2025-10-27 20:01:14 +00:00
655b3b01ff test: add verification script for ENABLE_TESTS mechanism
Created tests/verify-enable-tests.sh to verify that the ENABLE_TESTS
environment variable correctly controls test code inclusion:

- Production build (no ENABLE_TESTS): excludes test-content-script.js,
  background.js has if (false) for test code
- Test build (ENABLE_TESTS=true): includes test-content-script.js,
  background.js has if (true) for test code

Script verifies both scenarios and provides clear pass/fail output.

Verified: both production and test builds work as expected.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-27 17:01:01 +00:00
e6f025335a fix: remove test content script from production manifest
- Removed content_scripts entry that injected test code into all pages
- Modified test-lib.js to dynamically inject content script only during tests
- Test code no longer affects production users

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-26 18:13:48 +01:00
86f5c86f4f refactor: move Docker testing to pre-commit hook
- Created tests/pre-commit hook that builds and runs all tests
- Removed Docker usage documentation from README
- Hook runs code_quality and integration_test stages sequentially

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-26 18:10:43 +01:00
8bf58a2cb1 refactor(test): extract JavaScript test code to test-lib.js
- Created tests/test-lib.js with testBackgroundComputation() function
- Updated test_verify.py to load and execute test library via Marionette
- Modified Dockerfile to copy both test-lib.js and test_verify.py to /app/tests/
- Improved code organization and reusability

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-26 17:46:26 +01:00
8f47b56a20 refactor: move tests to tests/ directory and simplify verification
- Move test_verify.py and test-content-script.js to tests/
- Remove unused test_start_extension.sh
- Rename Dockerfile stages: test → code_quality, verify → integration_test
- Simplify test to single assertion: 17*2+3=37
- Add red TTY output for failures
- Fix runtime stage to properly copy built artifacts

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-26 13:23:13 +01:00