Fix adyen tests (#2545)

* update adyen plugin before tests

* add payments tag to PR template
This commit is contained in:
Anna Szczęch 2022-11-14 14:56:50 +00:00 committed by GitHub
parent 32cc9c9bdb
commit 1c70ad3a4b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 11 deletions

View file

@ -53,5 +53,6 @@ To run all tests, just select the stable checkbox. To speed up tests, increase t
20. [ ] translations
21. [ ] navigation
22. [ ] variants
23. [ ] payments
CONTAINERS=1

View file

@ -9,6 +9,7 @@ import {
createCheckout,
} from "../../../support/api/requests/Checkout";
import { getOrder } from "../../../support/api/requests/Order";
import { updatePlugin } from "../../../support/api/requests/Plugins";
import { getDefaultChannel } from "../../../support/api/utils/channelsUtils";
import {
addAdyenPayment,
@ -66,15 +67,19 @@ describe("Adyen payments", () => {
});
})
.then(
({
warehouse: warehouseResp,
shippingZone: shippingZoneResp,
shippingMethod: shippingMethodResp,
}) => {
({ warehouse: warehouseResp, shippingMethod: shippingMethodResp }) => {
warehouse = warehouseResp;
shippingMethod = shippingMethodResp;
},
)
.then(() => {
updatePlugin(
"mirumee.payments.adyen",
"adyen-auto-capture",
true,
defaultChannel.id,
);
});
createTypeAttributeAndCategoryForProduct({ name })
.then(({ productType, attribute, category }) => {
createProductInChannel({

View file

@ -1,10 +1,15 @@
export function updatePlugin(id, name, value) {
export function updatePlugin(id, name, value, channel) {
const channelLine = channel ? `channelId: "${channel}"` : "";
const mutation = `mutation{
pluginUpdate(id:"${id}", input:{
configuration:{
name:"${name}"
pluginUpdate(
id:"${id}",
${channelLine},
input:{
configuration:[{
name:"${name}",
value:"${value}"
}
}]
}){
errors{
field