I am trying to write some test cases using Insomnia and Chai where I am trying to read some JSON nested objects/values but struggling with syntax.
My JSON looks like below:
{
"Response": {
"requestId": "23232323",
"tests": [
{
"test": {
"id": 1,
"ids": [
{
"code": 1,
"text": "yes"
},
{
"code": 2,
"text": "yes"
}
]
}
}
]
}
}
I am trying to write something like this but it obviously doesn't work because I can see it's not the correct syntax.
expect(body.Response.tests.test.ids.text).to.equal("yes");
Any guidance is appreciated.