-
Notifications
You must be signed in to change notification settings - Fork 0
LL-350 add connected state to device card #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #14 +/- ##
=========================================
Coverage ? 33.60%
=========================================
Files ? 14
Lines ? 247
Branches ? 47
=========================================
Hits ? 83
Misses ? 164
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds a visual connection status indicator to IoT device cards on the dashboard, enabling users to quickly identify whether their LED devices are currently connected to the system. The implementation includes proper type handling, test infrastructure improvements, and documentation updates.
- Added a connection status display with colored indicators (green for connected, red for disconnected) at the top of each device card
- Improved test setup with JWT token secrets and email mocking to enable proper test execution
- Added
.env.examplefile to document required environment variables for new developers
Reviewed changes
Copilot reviewed 5 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
app/dashboard/page.tsx |
Adds connection status UI with visual indicator and text, excludes connected field from editable values |
tests/setup.ts |
Adds TOKEN_SECRET environment variable for JWT signing in test environment |
tests/account/account.api.test.ts |
Mocks sendEmail helper to prevent actual email sending during tests |
.env.example |
Documents required environment variables (MongoDB URL, JWT secret, SMTP config, domain) |
.gitignore |
Changes pattern from .env* to .env to allow .env.example to be committed |
.github/workflows/coverage.yml |
Adds verbose and default reporters to test output for better CI visibility |
package-lock.json |
Automatic npm updates adding peer dependency flags to various packages |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
PR Description
Added a connection status indicator to the device display on the dashboard. The indicator shows whether an IoT device is currently connected (green dot) or disconnected (red dot) as a read-only visual element at the top of the device card.
What type of PR is this? (check all applicable)
Why is this PR important?
Users need to know at a glance whether their physical LED devices are currently connected to the system. This visual feedback is essential for IoT device management and helps users quickly identify connection issues without needing to interact with the device.
Related Tickets & Documents
LL-350
Screenshots
The connection status indicator appears at the top of the device card:
How to test
npm testto verify all tests pass (10/10 tests passing)Added to documentation?
Testing & CI Improvements
This PR includes several important test infrastructure fixes that were discovered and resolved during development:
Issues Fixed:
Missing Test Infrastructure: Branch was created before test infrastructure was merged to master. Resolved by merging master to bring in PR LL-354 Pull Request #12 test setup.
JWT Token Secret Missing: Tests were failing in CI with
secretOrPrivateKey must have a valuebecauseTOKEN_SECRETwasn't set in test environment. Fixed by addingprocess.env.TOKEN_SECRETtotests/setup.ts.Email Sending in Tests: Signup tests were attempting to send real emails via
sendEmail(). Fixed by mocking@/app/helpers/mailerin test files.Limited CI Output: Test failures weren't showing detailed error messages. Enhanced CI workflow with
--reporters=default --reporters=jest-junit --verboseflags for better debugging.MongoDB Teardown Warnings: Added
force: trueflag to MongoDB cleanup intests/setup.tsto ensure clean shutdown.[optional] Are there any post-deployment tasks we need to perform?
None required. The
connectedfield already exists in the device schema and defaults totruefor new devices. Future work will involve implementing a heartbeat mechanism for physical devices to update their connection status.[optional] What gif best describes this PR?