test: update tests for system settings and user list enhancements
System Settings Tests (new file): - Create system_settings_test.go with comprehensive test coverage - Test admin-only access control - Test validation (15-1440 minute range) - Test error handling scenarios - Test integration with scheduler User Tests Cleanup: - Remove old TestScanSettings from user_test.go - Scan settings moved to system-wide (no longer per-user) Device Cap Tests Enhancement: - Update TestListUsersIncludesMaxDevices - Add assertion for device_count field - Verify both max_devices and device_count in response All tests verify the migration from per-user to system-wide scan settings.
This commit is contained in:
@@ -288,10 +288,13 @@ func TestListUsersIncludesMaxDevices(t *testing.T) {
|
||||
var users []map[string]interface{}
|
||||
json.NewDecoder(resp.Body).Decode(&users)
|
||||
|
||||
// Verify max_devices field is present in response
|
||||
// Verify max_devices and device_count fields are present in response
|
||||
if len(users) > 0 {
|
||||
_, hasMaxDevices := users[0]["max_devices"]
|
||||
assert.True(t, hasMaxDevices, "max_devices field should be present in user list")
|
||||
|
||||
_, hasDeviceCount := users[0]["device_count"]
|
||||
assert.True(t, hasDeviceCount, "device_count field should be present in user list")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user