saleor-dashboard/cypress/support/api/requests/Metadata.js
Karolina Rakoczy 2c64a966cc
Saleor 4437 refactor tests (#1389)
* reference type cypress working

* refactor

* remove screenshots

* add reference

* add slash marker

* run tests based on shop version

* fix run tests based on shop version

* fix run tests based on shop version

* change base url to localhost

* fix plugins

* fix plugins

* fix plugins

* fix plugins

* fix plugins

* fix plugins

* fix yml

* fix yml

* chage file names

* fix files names

* fix broken imports add checking for errors in grpah responses

* fix broken imports add checking for errors in grpah responses

* update jest

* fix snapshot
2021-09-27 12:04:21 +02:00

31 lines
652 B
JavaScript

export function updateMetadata(id, key, value) {
const mutation = `mutation{
updateMetadata(id:"${id}" input:{
key:"${key}",
value:"${value}"
}){
errors{
field
message
}
}
}`;
return cy.sendRequestWithQuery(mutation).its("body.data.updateMetadata");
}
export function updatePrivateMetadata(id, key, value) {
const mutation = `mutation{
updatePrivateMetadata(id:"${id}" input:{
key:"${key}",
value:"${value}"
}){
errors{
field
message
}
}
}`;
return cy
.sendRequestWithQuery(mutation)
.its("body.data.updatePrivateMetadata");
}