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
Open
Conversation
…backend and frontend
feat(arena): add streak freeze ui and mechanic
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
feat: Add Z Algorithm Interactive Quiz
…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
…-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.
…e, and browser client
Fix/arena history props
Fix/arena badges recursion
Fix/arena streak toast
Fix/arena streak hasfreeze
Fix/arena joinlobby validation
Fix/arena leaderboard scope
…rboard Fix/arena getinitials leaderboard
Fix/arena getinitials home
Fix/arena getinitials page
Fix/arena timezone desync
…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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
test