
* 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
37 lines
673 B
JavaScript
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");
|
|
}
|