price-point-api/bruno/products/list-products.bru

33 lines
599 B
Text
Raw Permalink Normal View History

meta {
name: List Products
type: http
seq: 1
}
get {
url: {{baseUrl}}/products
}
headers {
Authorization: Bearer {{authToken}}
}
assert {
res.status: equals 200
}
tests {
test("List products returns an array", function() {
const data = res.getBody();
expect(data).to.be.an("array");
});
test("Each product has correct shape", function() {
const data = res.getBody();
data.forEach(function(product) {
expect(product).to.have.property("id");
expect(product).to.have.property("name");
expect(product).to.have.property("barcode");
});
});
}