Test: update test to correct handle user item updates

This commit is contained in:
Carl Philipp Klemm 2026-04-26 14:01:05 +02:00
parent 25b9f87285
commit 7af4ec4957

View file

@ -239,11 +239,12 @@ private slots:
Sensor userUpdate(Sensor::TYPE_TEMPERATURE, 1, 25.0, "New Name", true);
store.sensorGotState(userUpdate, SENSOR_UPDATE_USER);
// Verify name and hidden were updated
// Verify name and hidden were updated, but field was NOT updated
// (USER updates only update name/hidden/groupName, not field)
QVERIFY(sensors->size() == 1);
QVERIFY(sensors->at(0).name == "New Name");
QVERIFY(sensors->at(0).hidden == true);
QVERIFY(sensors->at(0).field == 25.0);
QVERIFY(sensors->at(0).field == 20.0); // Field unchanged from initial
}
void testSensorStoreNonUserUpdateIgnoresNameAndHidden()