saleor-dashboard/cypress/support/api/requests/Plugins.js
Karol e69eb9cc5f
Cypress 2608 staff member tests (#2902)
* fix existing

* add SALEOR_3508

* add data-test-id needed for 3509

* add TODOs

* 3509 done, work on 3510

* done 3510

* found bug blocking test 3507, gh 2847

* pr review adjustments

* pr adjustments

* additional pr adjustments
2022-12-23 11:30:21 +01:00

37 lines
779 B
JavaScript

export function updatePlugin(id, name, value, channel) {
const channelLine = channel ? `channelId: "${channel}"` : "";
const mutation = `mutation{
pluginUpdate(
id:"${id}",
${channelLine},
input:{
configuration:[{
name:"${name}",
value:"${value}"
}]
}){
errors{
field
message
}
}
}`;
return cy.sendRequestWithQuery(mutation);
}
export function activatePlugin({ id, channel, active = true }) {
const channelLine = channel ? `channelId: "${channel}"` : "";
const mutation = `mutation{
pluginUpdate(id: "${id}" ${channelLine} input:{
active:${active}
}){
errors{
field
message
}
}
}`;
return cy.sendRequestWithQuery(mutation);
}