diff --git a/src/test/test.cpp b/src/test/test.cpp index b28023ec3..3b932bc96 100644 --- a/src/test/test.cpp +++ b/src/test/test.cpp @@ -1045,7 +1045,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const EMSESP::mqtt_.incoming("ems-esp/thermostat", "{\"cmd\":\"mode\",\"data\":\"heat\",\"id\":1}"); - // MQTT bad tests + // MQTT bad tests - these should all fail EMSESP::mqtt_.incoming("ems-esp/thermostate/mode", "auto"); // unknown device EMSESP::mqtt_.incoming("ems-esp/thermostat/modee", "auto"); // unknown command EMSESP::mqtt_.incoming("ems-esp/thermostat/mode/auto", "auto"); // invalid, not allowed @@ -1124,18 +1124,25 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const request.url("/rest/writeDeviceValue"); EMSESP::webDataService.write_device_value(&request, json); - // write value from web - testing hc9/seltemp - should fail! - char data7[] = "{\"id\":2,\"devicevalue\":{\"v\":\"55\",\"u\":1,\"n\":\"hc2 selected room temperature\",\"c\":\"hc9/seltemp\"}"; + // call reset command + char data7[] = "{\"device\":\"boiler\", \"cmd\":\"reset\",\"value\":\"error\"}"; deserializeJson(doc, data7); json = doc.as(); + request.url("/api"); + EMSESP::webAPIService.webAPIService_post(&request, json); + + emsesp::EMSESP::logger().warning("* these next ones should fail *"); + + // write value from web - testing hc9/seltemp - should fail! + char data8[] = "{\"id\":2,\"devicevalue\":{\"v\":\"55\",\"u\":1,\"n\":\"hc2 selected room temperature\",\"c\":\"hc9/seltemp\"}"; + deserializeJson(doc, data8); + json = doc.as(); request.url("/rest/writeDeviceValue"); EMSESP::webDataService.write_device_value(&request, json); - // emsesp::EMSESP::logger().notice("*"); - - // should fail - char data8[] = "{}"; - deserializeJson(doc, data8); + // should fail! + char data9[] = "{}"; + deserializeJson(doc, data9); json = doc.as(); request.url("/api/thermostat/mode/auto"); EMSESP::webAPIService.webAPIService_post(&request, json);