saleor-dashboard/cypress/support/api/requests/Plugins.js
Anna Szczęch 1c70ad3a4b
Fix adyen tests (#2545)
* update adyen plugin before tests

* add payments tag to PR template
2022-11-14 15:56:50 +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);
}