fix tests
This commit is contained in:
parent
0b5f475991
commit
0d00342b3a
@ -948,7 +948,7 @@ void TestJSONRPC::deviceChangedNotifications()
|
||||
|
||||
void TestJSONRPC::stateChangeEmitsNotifications()
|
||||
{
|
||||
enableNotifications({"Devices"});
|
||||
enableNotifications({"Devices", "States", "Logging", "Events"});
|
||||
bool found = false;
|
||||
|
||||
// Setup connection to mock client
|
||||
|
||||
@ -217,7 +217,7 @@ void TestLogging::eventLogs()
|
||||
QVERIFY2(devices.count() > 0, "There needs to be at least one configured Mock Device for this test");
|
||||
Device *device = devices.first();
|
||||
|
||||
enableNotifications({"Events"});
|
||||
enableNotifications({"Events", "Logging"});
|
||||
|
||||
// Setup connection to mock client
|
||||
QNetworkAccessManager nam;
|
||||
|
||||
@ -216,6 +216,7 @@ QVariantMap TestRules::createStateEvaluatorFromSingleDescriptor(const QVariantMa
|
||||
|
||||
void TestRules::setWritableStateValue(const DeviceId &deviceId, const StateTypeId &stateTypeId, const QVariant &value)
|
||||
{
|
||||
enableNotifications({"Devices"});
|
||||
QVariantMap params;
|
||||
params.insert("deviceId", deviceId);
|
||||
params.insert("stateTypeId", stateTypeId);
|
||||
|
||||
@ -2011,7 +2011,7 @@ void TestTimeManager::initTimeManager()
|
||||
{
|
||||
cleanupMockHistory();
|
||||
removeAllRules();
|
||||
enableNotifications({"Rules"});
|
||||
enableNotifications({"Rules", "Devices", "Events"});
|
||||
NymeaCore::instance()->timeManager()->stopTimer();
|
||||
qDebug() << NymeaCore::instance()->timeManager()->currentTime().toString();
|
||||
qDebug() << NymeaCore::instance()->timeManager()->currentDate().toString();
|
||||
|
||||
@ -369,10 +369,13 @@ void NymeaTestBase::enableNotifications(const QStringList &namespaces)
|
||||
foreach (const QString &ns, namespaces) {
|
||||
variantList << ns;
|
||||
}
|
||||
std::sort(variantList.begin(), variantList.end());
|
||||
QVariantMap notificationParams;
|
||||
notificationParams.insert("namespaces", variantList);
|
||||
QVariant response = injectAndWait("JSONRPC.SetNotificationStatus", notificationParams);
|
||||
QCOMPARE(response.toMap().value("params").toMap().value("namespaces").toList(), variantList);
|
||||
QVariantList resultList = response.toMap().value("params").toMap().value("namespaces").toList();
|
||||
std::sort(resultList.begin(), resultList.end());
|
||||
QCOMPARE(resultList, variantList);
|
||||
}
|
||||
|
||||
bool NymeaTestBase::disableNotifications()
|
||||
|
||||
Reference in New Issue
Block a user