This test suite validates the addition of the noise-aware-qnn-identifiability repository and the Identifiability metrics method to the portfolio website.
✅ All 8 tests passing
Test: noise-aware-qnn-identifiability repository is correctly added to the list
Validates:
- Repository exists with correct ID
- Title: "Noise-Aware QNN Identifiability"
- URL points to correct GitHub repository
- Short description matches expected text
- All 4 methods are present in the methods array
- Tags array contains: ['Quantum ML', 'Identifiability', 'Noise', 'Verification']
- Finding contains key correlation data
- Long description contains required content
Test: Identifiability metrics method is correctly added to the list
Validates:
- 'Identifiability metrics' exists in the methods array
- It appears in the correct position (7th item)
- Full methods array structure is correct with all 7 methods
Test Suite: getFilteredRepositories Function
6 comprehensive tests covering:
- Basic filtering - Selecting 'Identifiability metrics' returns only the noise-aware-qnn-identifiability repository
- No filter - Returns all repositories when no method is selected
- Non-matching filter - Returns empty array for non-existent methods
- Combined filters - Works correctly with tag filters
- Filter conflicts - Returns empty when filters don't match
- Search integration - Works correctly with search terms
# Install dependencies
npm install
# Run tests
npm test
# Run with coverage
npm run test:coverage
# Watch mode for development
npm run test:watch- Framework: Jest 29.7.0
- Environment: jsdom (browser simulation)
- Test File:
__tests__/repositories.test.js - Total Tests: 8
- Test Suites: 1
package.json- Node.js project configuration with Jestjest.config.js- Jest configuration for jsdom environment__tests__/repositories.test.js- Main test file with all test cases__tests__/README.md- Test documentation- Updated
.gitignore- Added node_modules and coverage directories
The tests validate the data structure and filtering logic by:
- Parsing script.js to extract repositories and methods arrays
- Extracting and executing the getFilteredRepositories function
- Mocking global state variables (searchTerm, selectedTags, selectedMethod)
- Running assertions against the actual data and filtering behavior
This ensures the website correctly displays and filters the new repository when users interact with the method filters.