saleor-dashboard/cypress/support/api/requests/Taxes.js
Anna Szczęch 644b58a914
Fix failed night schedule tests (#3015)
* fix e2e tests

* update test tag

* update tax config in tests failing on v310

* updatet taxes for product variant tests

* move updateRaxConfiguration to beforeEach

* fix imports

* change retries in config

* update data-test-id and remove failing wait for request
2023-01-25 11:32:28 +01:00

60 lines
1.2 KiB
JavaScript

export function getTaxConfigurationList() {
const query = `query{
taxConfigurations(first:100){
edges{
node{
id
channel{
id
slug
}
}
}
}
}
`;
return cy
.sendRequestWithQuery(query)
.then(resp => resp.body.data.taxConfigurations.edges);
}
export function updateTaxes({
id,
chargeTaxes = true,
taxCalculationStrategy = "FLAT_RATES",
pricesEnteredWithTax = "false",
}) {
const mutation = `mutation{
taxConfigurationUpdate(id:"${id}", input:{
chargeTaxes:${chargeTaxes}
displayGrossPrices:true
pricesEnteredWithTax:${pricesEnteredWithTax}
removeCountriesConfiguration: []
taxCalculationStrategy:${taxCalculationStrategy}
updateCountriesConfiguration: []
}){
errors{
field
message
}
}
}`;
return cy.sendRequestWithQuery(mutation);
}
export function getTaxClassList() {
const query = `query{
taxClasses(first:100){
edges{
node{
id
name
}
}
}
}
`;
return cy
.sendRequestWithQuery(query)
.then(resp => resp.body.data.taxClasses.edges);
}