Skip to content

test : added unit tests for shared utils, cookie consent, modules map, step runner, and practice data - #15

Open
tmdeveloper007 wants to merge 3330 commits into
syedahmedkhaderi:mainfrom
tmdeveloper007:test-more-utilities
Open

test : added unit tests for shared utils, cookie consent, modules map, step runner, and practice data#15
tmdeveloper007 wants to merge 3330 commits into
syedahmedkhaderi:mainfrom
tmdeveloper007:test-more-utilities

Conversation

@tmdeveloper007

Copy link
Copy Markdown

test

ezManish and others added 30 commits July 18, 2026 13:16
fix: add topicSlug to bookmark deletion request
fix: apply localDate range validation to bulkUpdateProgress to prevent streak spoofing
fix: replace naive brute-force with correct KMP algorithm in animation.jsx
fix: support IPv6 in RateLimitInterceptor.isValidIp to prevent bucketcollisions
fix: guard flow/capacity matrix access with optional chaining to prevent crash on missing edges
…ility

fix: expose sharedNotes toggle via PATCH visibility endpoint in both backend and frontend
…ting - Remove early return that bypassed all CSRF checks for /api/chatbot - Chatbot route now goes through standard CSRF validation like all other POST routes - Switch rate limiting from IP-based to authenticated user ID when available - Prevents CSRF attacks and API abuse via IP rotation - Fixes #3635
…6 timestamp in the token format: randomValue.timestamp.signature - HMAC now signs randomValue:timestamp to bind the signature to the timestamp - validateCsrfTokenEdge rejects tokens older than 24 hours or with future timestamps - Prevents indefinite reuse of stale CSRF tokens - Fixes #3636
… timestamp and 24-hour expiry to csrfToken.js (the active CSRF system) - Remove unused csrf.js which had a completely separate CSRF implementation - csrf.js used Node crypto with different secrets, formats, and validation logic - csrfToken.js (Web Crypto API) is the single source of truth for CSRF protection - Token format is now randomValue.timestamp.signature with HMAC-SHA256 - Fixes #3637
… up timer - Attach a no-op .catch() to timeout promise so its rejection is always handled - Track the setTimeout ID and call clearTimeout in a finally block - When getUser() wins the race the timer is cancelled preventing memory leaks - Prevents unhandled rejection crash in Node.js 15+ - Fixes #3633
…e forced sameSite lax override from authProxy setAll callback - Supabase now controls the SameSite attribute for its auth cookies - Change CSRF token cookie from sameSite lax to strict for stronger CSRF protection - Fixes #3634
ezManish and others added 30 commits July 26, 2026 21:25
…-button

feat: add copy button for algorithm complexities
fix(random): eliminate modulo bias in generateSecureCode using rejection sampling
…disconnect

fix(arena): stop deleting rate limit key on disconnect
…pabase-v2

fix(apiClient): use supabase.auth.signOut for session cleanup on 401
…pted-json

fix(arena): handle corrupted JSON in queue health checker
…-topic-allowlist

fix(arena): validate match topic against server-side verification allowlist
- Add dynamic resolution fallback to src/lib/logger.js when pino module is unavailable in standalone test runners.
- Add --disable-warning=MODULE_TYPELESS_PACKAGE_JSON flag to npm run test:security script in package.json.
- Ensure 100% security test pass rate (84/84 tests) without module reparsing warnings.
…r playback shortcuts

- Add Escape key listener, backdrop click dismiss, and ARIA dialog properties to ThemeSettingsModal.
- Add Space, ArrowLeft, ArrowRight, and R key shortcuts to PlaybackControls.
- Ensure active input elements bypass keyboard shortcuts.
…ceManager

- Add __tests__/fenwickTreeLogic.test.js covering buildBIT, updateGenerator, and queryGenerator.
- Add __tests__/persistence.test.js covering get/set/remove, JSON fallback, and server merge utilities.
- Update jest.config.js testMatch pattern to discover unit test suites (9/9 suites, 35/35 tests passing).
- Integrate html2canvas in VisualizerCanvas component to export high-resolution visualization snapshots.
- Add responsive Export PNG button with loading state indicator and showExportButton prop.
- Ensure full accessibility and smooth touch interaction.
…clear button

- Fix bug where selecting search suggestions did not execute section filtering.
- Add clear (X) search button to reset input and filter state.
- Add ARIA combobox and listbox attributes for accessibility compliance.
…back

fix(tests): add logger fallback and eliminate typeless module warnings
…controls

feat(a11y): add modal keyboard escape, ARIA attributes, and visualize…
…nce-unit-tests

test(unit): add unit test suites for Fenwick Tree logic and Persisten…
…pshot

feat(visualizer): add Export PNG snapshot feature to VisualizerCanvas
…-and-a11y

fix(searchbar): trigger search filtering on suggestion click and add …
…tep runner, and practice data

- __tests__/sharedUtils.test.js: 24 tests for escapeHtml, isValidHttpUrl, getSupabaseConfig
- __tests__/cookieConsent.test.js: 18 tests for consent helpers using jsdom localStorage
- __tests__/modulesMap.test.js: 22 tests verifying UUID/kebab-id formats for all entries
- __tests__/stepRunner.test.js: 7 tests for createSyncStepRunner, registerAlgorithm, generateSteps
- __tests__/practiceData.test.js: 11 tests for practice data structure and required fields

All 111 tests pass (76 new + 35 pre-existing).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.