towerops/test/towerops_web/live
Graham McIntire 3583624e0d
fix: prevent nil boolean error in device edit page
Fixed production bug where visiting the edit page for a device with no
SNMP discovery data would crash with "expected boolean on left-side of
'and', got: nil" error.

The mikrotik_device?/1 function was using && operator which returns nil
when device.snmp_device is nil, instead of returning false. The template
conditional on line 455 requires a proper boolean value.

Changed from:
  device.snmp_device && (...)

To:
  not is_nil(device.snmp_device) and (...)

This ensures the function always returns a boolean (true/false) instead
of potentially returning nil.

Added regression test to verify the page renders correctly when a device
has no SNMP discovery data yet.

Fixes: https://app.honeybadger.io/projects/136860/faults/127120431
2026-02-03 15:32:51 -06:00
..
account_live fix TOTP enrollment with recovery codes 2026-01-31 14:54:44 -06:00
agent_live test fixes 2026-01-26 15:27:59 -06:00
device_live fix: prevent nil boolean error in device edit page 2026-02-03 15:32:51 -06:00
device_live_nested faster tests 2026-01-27 09:30:18 -06:00
graph_live test cleanup 2026-01-19 13:29:38 -06:00
org purge more passkey and gettext updates 2026-02-02 10:20:59 -06:00
org_live Add tests for Monitoring.Ping and OrgLive.New 2026-01-13 08:54:49 -06:00
agent_live_test.exs more tests 2026-02-03 10:43:30 -06:00
alert_live_test.exs test fixes 2026-01-26 15:27:59 -06:00
dashboard_live_test.exs test fixes 2026-01-26 15:27:59 -06:00
my_data_live_test.exs feat: migrate equipment features to gettext and fix sudo mode tests 2026-02-02 12:41:58 -06:00
org_live_test.exs add device/org limit 2026-01-27 14:14:25 -06:00
user_registration_live_test.exs Use detected timezone from session in user registration 2026-02-01 12:18:33 -06:00
user_reset_password_live_test.exs add HIBP password check 2026-02-01 08:57:01 -06:00
user_settings_live_test.exs feat: migrate equipment features to gettext and fix sudo mode tests 2026-02-02 12:41:58 -06:00