I am trying to validate the existence of a key-value pair in an object using should.js syntax like this:
cy.gey(selector).should('have.property', 'Company Feature: ', ['open space ']);
. However, I encountered this error message Error: AssertionError: expected { Object (Company Feature: , Name: ) } to have property 'Company Feature: ' of [ 'open space ' ], but got [ 'open space ' ]
. I'm not sure which part is causing the mismatch or if it's a bug within should.js?
// debug output
{
"Company Feature: ": [
"open space "
],
"Name: ": [
"John, Amazon "
]
}
// test.ts
cy.gey(selector).should('have.property', 'Company Feature: ', ['open space ']);
// html
<div class="container">
<span>
<span class="title">Company Feature: </span>
<span class="text">open space </span>
</span>
<span>
<span class="title">Name: </span>
<span class="text">John, Amazon </span>
</span>
</div>