2021-07-20 10:59:23 +00:00
|
|
|
import { getDefaultAddress } from "./utils/Utils";
|
|
|
|
|
2021-07-12 08:50:50 +00:00
|
|
|
export function updateShopWeightUnit(weightUnit) {
|
|
|
|
const mutation = `mutation{
|
|
|
|
shopSettingsUpdate(input:{
|
|
|
|
defaultWeightUnit: ${weightUnit}
|
|
|
|
}){
|
|
|
|
errors{
|
|
|
|
field
|
|
|
|
message
|
|
|
|
}
|
|
|
|
shop{
|
|
|
|
defaultWeightUnit
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}`;
|
2021-07-26 09:58:47 +00:00
|
|
|
return cy
|
|
|
|
.sendRequestWithQuery(mutation)
|
2021-07-27 08:57:17 +00:00
|
|
|
.wait(5000)
|
2021-07-26 09:58:47 +00:00
|
|
|
.its("body.data.shopSettingsUpdate");
|
2021-07-12 08:50:50 +00:00
|
|
|
}
|
2021-07-20 10:59:23 +00:00
|
|
|
|
|
|
|
export function updateShopAddress(address) {
|
|
|
|
const input = getDefaultAddress(address, "input");
|
|
|
|
const mutation = `mutation{
|
|
|
|
shopAddressUpdate(${input}){
|
|
|
|
errors{
|
|
|
|
field
|
|
|
|
message
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}`;
|
|
|
|
return cy.sendRequestWithQuery(mutation);
|
|
|
|
}
|
|
|
|
|
|
|
|
export function getShopInfo() {
|
|
|
|
const query = `query{
|
|
|
|
shop{
|
|
|
|
name
|
2021-09-27 10:04:21 +00:00
|
|
|
version
|
2021-07-20 10:59:23 +00:00
|
|
|
domain{
|
|
|
|
host
|
|
|
|
}
|
|
|
|
description
|
|
|
|
companyAddress{
|
|
|
|
companyName
|
|
|
|
streetAddress1
|
|
|
|
streetAddress2
|
|
|
|
city
|
|
|
|
cityArea
|
|
|
|
postalCode
|
|
|
|
country{
|
|
|
|
code
|
|
|
|
}
|
|
|
|
countryArea
|
|
|
|
phone
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}`;
|
|
|
|
return cy.sendRequestWithQuery(query).its("body.data.shop");
|
|
|
|
}
|