I have a candidates schema with a field contactDetails containing an object. The test named in the issue uses this logic to determine a field to query with:
const property = Object.keys(record).filter(k => k !== 'id')[0];
Which selects contactDetails, but appears to be unable to turn that into a query string which works.
Error:
1) candidate model GET /candidates accepts search params in the querystring:
AssertionError: [] must be equivalent to [{"address1":"94864 Grant Field","country":"New Caledonia","email":"Sofia_Reilly29@yahoo.com","phone":"601.689.4664","postcode":"43086-2527","state":"New Magdalen","suburb":"Cartwrighthaven"}]
+ expected - actual
-[]
+[
+ {
+ "address1": "94864 Grant Field"
+ "country": "New Caledonia"
+ "email": "Sofia_Reilly29@yahoo.com"
+ "phone": "601.689.4664"
+ "postcode": "43086-2527"
+ "state": "New Magdalen"
+ "suburb": "Cartwrighthaven"
+ }
+]
Relevant schema section:
"contactDetails": {
"description": "The contact details of the Candidate",
"type": "object",
"additionalProperties": false,
"required": [
"email",
"address1",
"suburb",
"postcode",
"state",
"country",
"phone"
],
"properties": {
"email": {
"description": "The candidate's email address",
"type": "string",
"example": "hello@me.com",
"faker": "internet.email"
},
"address1": {
"description": "First line of the candidate's address",
"type": "string",
"example": "Level 10",
"faker": "address.streetAddress"
},
"address2": {
"description": "First line of the candidate's address",
"type": "string",
"example": "191 Fake Street",
"faker": "address.secondaryAddress"
},
"suburb": {
"description": "Suburb or city of the candidate's address",
"type": "string",
"example": "Hillsville",
"faker": "address.city"
},
"postcode": {
"description": "Postcode of the candidate's address",
"type": "string",
"example": "1234",
"faker": "address.zipCode"
},
"state": {
"description": "State of the candidate's address",
"type": "string",
"example": "NSW",
"faker": "address.city"
},
"country": {
"description": "Country of the candidate's address",
"type": "string",
"example": "Australia",
"faker": "address.country"
},
"phone": {
"description": "Phone number of the candidate",
"type": "string",
"example": "0411111111",
"faker": "phone.phoneNumber"
}
}
}
I have a
candidatesschema with a fieldcontactDetailscontaining an object. The test named in the issue uses this logic to determine a field to query with:Which selects
contactDetails, but appears to be unable to turn that into a query string which works.Error:
1) candidate model GET /candidates accepts search params in the querystring: AssertionError: [] must be equivalent to [{"address1":"94864 Grant Field","country":"New Caledonia","email":"Sofia_Reilly29@yahoo.com","phone":"601.689.4664","postcode":"43086-2527","state":"New Magdalen","suburb":"Cartwrighthaven"}] + expected - actual -[] +[ + { + "address1": "94864 Grant Field" + "country": "New Caledonia" + "email": "Sofia_Reilly29@yahoo.com" + "phone": "601.689.4664" + "postcode": "43086-2527" + "state": "New Magdalen" + "suburb": "Cartwrighthaven" + } +]Relevant schema section: