saleor-dashboard/cypress/support/api/requests/Plugins.js
Karol 9c605f8d1b
[cypress] add tests for gift cards bulk create and export (#2801)
* first draft

* fixed data-test-id

* done

* restore port for cypress

* change email

* pr improvments

* add csv check

* adjustments

* added check for xlsx

* change name

* change name

* remove cy log

* remove cy log

* add yaml cypress mailhog var
2022-12-13 08:04:54 +01:00

37 lines
794 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},configuration:
}){
errors{
field
message
}
}
}`;
return cy.sendRequestWithQuery(mutation);
}