
* 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
33 lines
881 B
JavaScript
33 lines
881 B
JavaScript
import {
|
|
getTaxClassList,
|
|
getTaxConfigurationList,
|
|
updateTaxes,
|
|
} from "../requests/Taxes";
|
|
|
|
export function updateTaxConfigurationForChannel({
|
|
channelSlug = "default-channel",
|
|
chargeTaxes = true,
|
|
taxCalculationStrategy = "FLAT_RATES",
|
|
pricesEnteredWithTax = "false",
|
|
}) {
|
|
getTaxConfigurationList().then(taxConfigurationList => {
|
|
const taxConfigurationForChannel = taxConfigurationList.find(
|
|
taxConfiguration => taxConfiguration.node.channel.slug === channelSlug,
|
|
);
|
|
updateTaxes({
|
|
id: taxConfigurationForChannel.node.id,
|
|
chargeTaxes,
|
|
taxCalculationStrategy,
|
|
pricesEnteredWithTax,
|
|
});
|
|
});
|
|
}
|
|
|
|
export function getDefaultTaxClass() {
|
|
getTaxClassList().then(taxClassArray => {
|
|
const taxClass = taxClassArray.find(
|
|
taxClassItem => taxClassItem.node.name === "No Taxes",
|
|
);
|
|
return taxClass.node;
|
|
});
|
|
}
|