test: add device operation state tests (PR 1.2)#78
Merged
JanZachmann merged 1 commit intoomnect:mainfrom Jan 14, 2026
Merged
Conversation
JanZachmann
added a commit
to JanZachmann/omnect-ui
that referenced
this pull request
Dec 18, 2025
Update FRONTEND_TEST_CONCEPT.md to reflect: Phase 1 Complete (92 tests): - PR omnect#77: Authentication Tests (17 tests) - PR omnect#78: Device Tests (27 tests) - PR omnect#79: Network Tests (21 tests) - PR omnect#80: Reconnection Tests (27 tests) Phase 2 Skipped: - Effect emission testing deemed low-value after Phase 1 implementation - Effects are auto-generated and handled by well-tested macros - Testing implementation details (how Core communicates) vs behavior (what it does) - Response handling tests in Phase 1 already validate request/response cycles Lessons Learned: - Colocated tests improve maintainability - Domain organization mirrors code structure - Response-focused testing validates behavior without coupling - Avoid testing auto-generated types and macro usage Key Patterns: - Use `let _ = app.update(...)` for unused results - Test response events not request events - Organize with nested modules - Use helper functions for test data Signed-off-by: Jan Zachmann <50990105+JanZachmann@users.noreply.github.com>
JanZachmann
added a commit
to JanZachmann/omnect-ui
that referenced
this pull request
Dec 19, 2025
Update FRONTEND_TEST_CONCEPT.md to accurately reflect that this branch (test/core-auth) only contains the authentication tests from PR 1.1. The document previously indicated all of Phase 1 was complete (92 tests across 4 PRs), but this branch only has 17 authentication tests. Changes: - Update Phase 1 status from "Complete (92 tests)" to "In Progress (17 tests)" - Mark PR omnect#77 (Authentication Tests) as complete for this branch - Mark PR omnect#78-80 as pending (not in this branch) - Update ROI Summary table to show correct progress (17/92 tests) - Fix markdown formatting issues (blank lines around lists/headings) Signed-off-by: Jan Zachmann <50990105+JanZachmann@users.noreply.github.com>
1191ac8 to
65231a4
Compare
Add unit tests for device operations and WebSocket updates: - System info: updates and replacements via WebSocket - Online status: online/offline transitions - Factory reset: state machine and network error handling - Reboot: state transitions and error handling - Firmware upload: progress tracking, success/failure - Update operations: load and run update flows Tests are colocated with handlers in websocket.rs and device/mod.rs. Signed-off-by: Jan Zachmann <50990105+JanZachmann@users.noreply.github.com>
65231a4 to
d2b2bab
Compare
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
Adds comprehensive unit tests for device operations and WebSocket updates in the Crux Core, implementing Phase 1.2 of the testing strategy.
Changes
WebSocket Tests (13 tests)
Device Operation Tests (14 tests)
Test Organization
src/app/src/update/websocket.rsandsrc/app/src/update/device/mod.rscrux_core::testing::AppTesterfor deterministic state testingTest Results
All tests pass with no warnings from clippy.
Signed-off-by: Jan Zachmann 50990105+JanZachmann@users.noreply.github.com