Fix identityref passing through sysrepo and NETCONF

Change-Id: Ie0f712befe56c2fcea52401a12c33812b7fb9066
diff --git a/tests/datastore_access.cpp b/tests/datastore_access.cpp
index 6979dba..a1c8906 100644
--- a/tests/datastore_access.cpp
+++ b/tests/datastore_access.cpp
@@ -330,6 +330,24 @@
         REQUIRE(datastore.getItems("/example-schema:unionIntString") == expected);
     }
 
+    SECTION("identityref") {
+        datastore.setLeaf("/example-schema:beast", identityRef_{"example-schema", "Mammal"});
+        REQUIRE_CALL(mock, write("/example-schema:beast", std::nullopt, "example-schema:Mammal"s));
+        datastore.commitChanges();
+        DatastoreAccess::Tree expected {
+            {"/example-schema:beast", identityRef_{"example-schema", "Mammal"}},
+        };
+        REQUIRE(datastore.getItems("/example-schema:beast") == expected);
+
+        datastore.setLeaf("/example-schema:beast", identityRef_{"Whale"});
+        REQUIRE_CALL(mock, write("/example-schema:beast", "example-schema:Mammal", "example-schema:Whale"s));
+        datastore.commitChanges();
+        expected = {
+            {"/example-schema:beast", identityRef_{"example-schema", "Whale"}},
+        };
+        REQUIRE(datastore.getItems("/example-schema:beast") == expected);
+    }
+
     SECTION("operational data")
     {
         MockDataSupplier mockOpsData;