refactor(tests): replace temporary variable pointer pattern with new() builtin
Simplify device update test by using new(false) and new(int32(10)) instead of declaring named sync variables and taking their addresses.
This commit is contained in:
@@ -147,12 +147,10 @@ func TestUpdateDevice(t *testing.T) {
|
||||
device := setup.CreateDevice(t, "Test Device", "koreader", "test-device-123")
|
||||
|
||||
// Update device
|
||||
syncEnabled := false
|
||||
syncFreq := int32(10)
|
||||
updateRequest := handlers.DeviceUpdateRequest{
|
||||
DeviceName: "Updated Device Name",
|
||||
SyncEnabled: &syncEnabled,
|
||||
SyncFrequencyMinutes: &syncFreq,
|
||||
SyncEnabled: new(false),
|
||||
SyncFrequencyMinutes: new(int32(10)),
|
||||
}
|
||||
updateBody, _ := json.Marshal(updateRequest)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user