mirror of
https://github.com/alexhopeoconnor/WiFiManager.git
synced 2026-10-22 02:32:10 +10:00
Portal customization API v2, SPA hardening, and test cleanup
- Group portal state into brand/pages/actions/layout structs; portal* API - Bootstrap JSON: nested brand/context/pages/actions/layout; param kind - Handlers: PROGMEM default CSS when no override/append; dynamic CSS path - PortalAppJS: portal timeout countdown; safe WiFi scan DOM; serialized scan-status polling; fetch error handling; wm:view-changed on redirects - CSS: scan list icon alignment; wm-status for timeout - Tests: remove low-value/no-op tests; trim fragile JS substring checks
This commit is contained in:
@@ -36,26 +36,18 @@ void test_configuration_setters() {
|
||||
wm.setShowDnsFields(false);
|
||||
|
||||
// Test portal behavior
|
||||
wm.setCaptivePortalEnable(true);
|
||||
wm.setCaptivePortalEnable(false);
|
||||
wm.portalSetBehaviorCaptivePortalEnabled(true);
|
||||
wm.portalSetBehaviorCaptivePortalEnabled(false);
|
||||
|
||||
// Test custom title (no getter available, but we can verify it doesn't crash)
|
||||
wm.setTitle("TestTitle");
|
||||
|
||||
// Verify some settings can be retrieved (if getters exist)
|
||||
// Note: Not all setters have getters, but we verify they don't crash
|
||||
// All setters executed without crash
|
||||
TEST_ASSERT_TRUE_MESSAGE(true, "All configuration setters executed without crash");
|
||||
|
||||
// Verify setters can be called multiple times with different values
|
||||
// Test custom title path
|
||||
wm.portalSetBrandTitle("TestTitle");
|
||||
|
||||
// Call setters multiple times with different values.
|
||||
wm.setConfigPortalTimeout(60);
|
||||
wm.setConnectTimeout(30);
|
||||
wm.setHttpPort(8080);
|
||||
wm.setMinimumSignalQuality(50);
|
||||
|
||||
// Verify no crash after multiple calls
|
||||
TEST_ASSERT_TRUE_MESSAGE(true, "Configuration setters can be called multiple times");
|
||||
|
||||
Serial.println("[TEST] Configuration setters test completed successfully");
|
||||
}
|
||||
|
||||
@@ -76,7 +68,6 @@ void test_set_and_get_hostname() {
|
||||
TEST_ASSERT_FALSE_MESSAGE(wm.setHostname("trailing-"), "Hostnames cannot end with a hyphen");
|
||||
|
||||
(void)wm.getWiFiHostname();
|
||||
TEST_ASSERT_TRUE_MESSAGE(true, "getWiFiHostname() executed after hostname validation checks");
|
||||
|
||||
Serial.println("[TEST] setHostname() and getWiFiHostname() test completed successfully");
|
||||
}
|
||||
@@ -108,9 +99,6 @@ void test_wifi_ap_configuration_setters() {
|
||||
wm.setWiFiAutoReconnect(true);
|
||||
wm.setWiFiAutoReconnect(false);
|
||||
|
||||
// All setters executed without crash
|
||||
TEST_ASSERT_TRUE_MESSAGE(true, "All WiFi AP configuration setters executed without crash");
|
||||
|
||||
Serial.println("[TEST] WiFi AP configuration setters test completed successfully");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user