test: add comprehensive network configuration tests (PR 1.3) - #79
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>
Add 21 tests covering network configuration state transitions: Network Form State Management (4 tests): - Start edit transitions to editing state with correct form data - Update with unchanged data keeps clean flag - Update with changed data sets dirty flag - Reset restarts edit from original adapter data Network Configuration Responses (7 tests): - Static IP with rollback enters waiting state - Static IP without rollback enters waiting state - DHCP with rollback enters waiting state - DHCP without rollback goes to idle with spinner - Non-server adapter returns to idle - Error resets to editing state IP Change Detection (4 tests): - Tick increments attempt counter - Tick skips polling when switching to DHCP - Timeout transitions to timeout state - Successful healthcheck on new IP updates model Rollback Acknowledgment (4 tests): - Clears rollback flag in healthcheck - Handles missing healthcheck gracefully - Ack rollback response stops loading - Ack rollback response error sets error message Signed-off-by: Jan Zachmann <50990105+JanZachmann@users.noreply.github.com>
JanZachmann
force-pushed
the
test/core-network
branch
from
January 14, 2026 09:29
3ad7a46 to
7e82b2c
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
Add comprehensive unit tests for network configuration state transitions in the Crux Core.
This PR is part of Phase 1 (Core State Transitions) of the frontend testing strategy, specifically PR 1.3: Network Tests.
Tests Added (21 total)
Network Form State Management (4 tests)
Network Configuration Responses (7 tests)
IP Change Detection (4 tests)
Rollback Acknowledgment (4 tests)
Test Coverage
Tests validate:
QA
cargo test -p omnect-ui-corecargo clippy -p omnect-ui-core