Fix critical bugs and add comprehensive PlayController tests#27
Open
DigitalBlueprint239 wants to merge 1 commit intomasterfrom
Open
Fix critical bugs and add comprehensive PlayController tests#27DigitalBlueprint239 wants to merge 1 commit intomasterfrom
DigitalBlueprint239 wants to merge 1 commit intomasterfrom
Conversation
…low copy, test setup - Add missing addToOfflineQueue function in firestore.ts (fixed 6 TS errors and build failure) - Fix CanvasArea.tsx invalid import path using colons instead of slashes - Fix AuthProvider context mismatch: App.tsx now uses hooks/useAuth so Dashboard shares the same context - Fix shallow copy bug in PlayController.createRoute — points are now properly deep-copied - Add comprehensive test infrastructure: Firebase mocks, browser API mocks, 43 new PlayController tests - All 44 tests pass, zero TypeScript errors, clean production build https://claude.ai/code/session_014M61BgZxsHXT2z8aiC3QMr
❌ Deploy Preview for magical-starlight-0c1207 failed.
|
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.
Summary
This PR fixes 5 critical bugs that prevented the application from building and running, and adds comprehensive test coverage for the PlayController module. All tests now pass (44/44) and TypeScript compilation succeeds with 0 errors.
Key Changes
Bug Fixes
addToOfflineQueuefunction (src/services/firestore.ts): Added the missing function that was being called 6 times but never defined, causing TypeScript build failuressrc/components/SmartPlaybook/components/CanvasArea.tsx): Fixed malformed import path from'../:components:SmartPlaybook:Field.js'to'../Field.js'src/App.tsx): Changed AuthProvider import from anonymous-only context to full email/password/Google auth context to match Dashboard's useAuth hook, preventing runtime crashessrc/components/SmartPlaybook/PlayController.js): Fixed route point mutation by changing from shallow array copy[...points]to deep copypoints.map(p => ({ ...p }))src/setupTests.ts,src/App.test.tsx): Added comprehensive Firebase mocks and browser API mocks (matchMedia, Notification) to enable tests to run in JSDOM environmentNew Test Coverage
src/components/SmartPlaybook/PlayController.test.js: 43 comprehensive tests covering:Test Infrastructure
src/setupTests.tswith Firebase mocks and browser API polyfillssrc/__mocks__/firebase.tsfor Firebase module mockingsrc/App.test.tsxwith component-level mocks for PWA and push notificationsVerification
https://claude.ai/code/session_014M61BgZxsHXT2z8aiC3QMr