vaimee / desmo-dapp

0 stars 1 forks source link

test rework finished, (some fix in the test unit too) #13

Closed FerrariAndrea closed 2 years ago

FerrariAndrea commented 2 years ago

Coverage test: 96.35% Test passed: 75/76

The test which is not passing is the wot.test.13, this test is performing that query on Zion: $.forms[?@.href=~'http://(.)+/stopligth_01']

That query should be correct and should give an array of TD, but instead is retrieving a void array.

In my local Zion, there are TDs that should match that query, like:

  "properties": {
            "value": {
                "@type": "xsd:string",
                "forms": [
                    {
                        "op": [
                            "readproperty",
                            "writeproperty"
                        ],
                        "href": "http://localhost:8080/stopligth_01/properties/value",
                        "contentType": "application/json"
                    },
                    {
                        "op": [
                            "readproperty",
                            "writeproperty"
                        ],
                        "href": "http://localhost:8080/stopligth_01/properties/value",
                        "contentType": "application/json"
                    },

(I pulled the Zion repo, and it should be the last version)

FerrariAndrea commented 2 years ago

Guys the problem with the wot test 13 (on Zion) was an oversight, just a mismatch with the actual Zion registered TDs. Now it is fixed

relu91 commented 2 years ago

Hi, I've tried to review the PR but there are many criticalities that we need to discuss in a meeting. Perhaps I misunderstood your reasoning but I think the new code is not really an improvement of the current status. Jest requires a specific testing structure and implementation have checked how Zion is tested?

FerrariAndrea commented 2 years ago

Sure, I follow an easy tutorial on jest and then I checked Zion looking for jest tests like "testName.test.ts" but I didn't find anything. Where are the Zion tests? For sure I was looking in the wrong place. Let me know what I should do, if you want a call, I'm available.