towerops/test
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
..
integration forgot password flow 2026-01-31 17:03:22 -06:00
mix/tasks more tests 2026-02-03 10:19:56 -06:00
snmpkit more tests 2026-02-03 10:43:30 -06:00
support feat: migrate equipment features to gettext and fix sudo mode tests 2026-02-02 12:41:58 -06:00
towerops more tests 2026-02-03 15:27:05 -06:00
towerops_web fix: prevent nil boolean error in device edit page 2026-02-03 15:32:51 -06:00
test_helper.exs complete overhaul of snmp engine to C nif 2026-01-30 12:27:12 -06:00
towerops_native_test.exs complete overhaul of snmp engine to C nif 2026-01-30 12:27:12 -06:00