Browse Source

Add tests for QML grpc subscription returnValue

Alexey Edelev 4 years ago
parent
commit
7f6d84b1a1
1 changed files with 6 additions and 1 deletions
  1. 6 1
      tests/test_grpc_qml/qml/tst_grpc.qml

+ 6 - 1
tests/test_grpc_qml/qml/tst_grpc.qml

@@ -37,6 +37,11 @@ TestCase {
         testFieldString: "Test string"
         testFieldString: "Test string"
     }
     }
 
 
+    QtObject {
+        id: returnMsg
+        property string ret: serverStreamSubscription.returnValue.testFieldString
+    }
+
     GrpcSubscription {
     GrpcSubscription {
         id: serverStreamSubscription
         id: serverStreamSubscription
         property bool ok: true
         property bool ok: true
@@ -48,7 +53,7 @@ TestCase {
         argument: stringMsg
         argument: stringMsg
         onUpdated: {
         onUpdated: {
             ++updateCount;
             ++updateCount;
-            ok = ok && value.testFieldString === "Test string" + updateCount
+            ok = ok && value.testFieldString === ("Test string" + updateCount) && returnMsg.ret == ("Test string" + updateCount)
         }
         }
         onError: {
         onError: {
             console.log("Subscription error: " + status.code + " " + status.message)
             console.log("Subscription error: " + status.code + " " + status.message)