saleor-dashboard/cypress/apiRequests/storeFront/ProductDetails.js
Karolina 746ce8b95f
Saleor 1745 tests for discounts sales (#998)
* test plan for sales - discounts

* create sale

* passing tests for sales

* tests for collections

* remove eslint diable in sales tests

* remove eslint-disable

* move shared selectors

* move shared selectors

* fix indentation in requests

* add formatDate function

* remove moment

* remove moment
2021-03-12 15:57:02 +01:00

37 lines
673 B
JavaScript

export function getProductDetails(productId, channelId) {
const query = `fragment BasicProductFields on Product {
id
name
}
fragment Price on TaxedMoney {
gross {
amount
currency
}
}
fragment ProductVariantFields on ProductVariant {
id
sku
name
pricing {
price {
...Price
}
}
}
query ProductDetails{
product(id: "${productId}", channel: "${channelId}") {
...BasicProductFields
variants {
...ProductVariantFields
}
isAvailable
isAvailableForPurchase
availableForPurchase
}
}`;
return cy.sendRequestWithQuery(query, "token");
}