Adjust existing tests to changes

This commit is contained in:
Kamil Grygierzec 2023-11-15 10:49:18 +01:00
parent 9c462870eb
commit 80be385cfe
No known key found for this signature in database
GPG key ID: 7F54EE42DAD4B9E9
6 changed files with 84 additions and 46 deletions

View file

@ -37,7 +37,7 @@ final class ManagingPaymentMethodsContext implements Context
/**
* @When I want to modify the :paymentMethod payment method
*/
public function iWantToModifyAPaymentMethod(PaymentMethodInterface $paymentMethod)
public function iWantToModifyAPaymentMethod(PaymentMethodInterface $paymentMethod): void
{
$this->updatePage->open(['id' => $paymentMethod->getId()]);
}
@ -247,7 +247,7 @@ final class ManagingPaymentMethodsContext implements Context
/**
* @When I switch the way payment methods are sorted by :field
* @When I start sorting payment methods by :field
* @When I switch the way payment methods are sorted descending by :field
* @When I switch the way payment methods are sorted to descending by :field
* @Given the payment methods are already sorted by :field
*/
public function iSortPaymentMethodsBy($field)

View file

@ -7,7 +7,13 @@
"method": {
"@id": "\/api\/v2\/admin\/payment-methods\/CASH_ON_DELIVERY",
"@type": "PaymentMethod",
"name": "Cash on delivery"
"translations": {
"en_US": {
"@id": "\/api\/v2\/admin\/payment-method-translations\/@integer@",
"@type": "PaymentMethodTranslation",
"name": "Cash on delivery"
}
}
},
"currencyCode": "USD",
"amount": 6500,

View file

@ -7,7 +7,13 @@
"method": {
"@id": "\/api\/v2\/shop\/payment-methods\/CASH_ON_DELIVERY",
"@type": "PaymentMethod",
"name": "Cash on delivery"
"translations": {
"en_US": {
"@id": "\/api\/v2\/shop\/payment-method-translations\/@integer@",
"@type": "PaymentMethodTranslation",
"name": "Cash on delivery"
}
}
},
"currencyCode": "USD",
"amount": 6500,

View file

@ -22,30 +22,40 @@
"name": "Bank transfer",
"description": @string@,
"instructions": null
},
{
"@id": "\/api\/v2\/shop\/payment-methods\/PAYPAL",
"@type": "PaymentMethod",
"id": @integer@,
"code": "PAYPAL",
"position": 3,
"name": "PayPal",
"description": @string@,
"instructions": null
}
],
"hydra:totalItems": 2,
"hydra:view": {
"@id": @string@,
"@type": "hydra:PartialCollectionView"
},
"hydra:search": {
"hydra:totalItems": 3,
"hydra:view": {
"@id": "\/api\/v2\/shop\/payment-methods?paymentId=@string@&tokenValue=@string@",
"@type": "hydra:PartialCollectionView"
},
"hydra:search": {
"@type": "hydra:IriTemplate",
"hydra:template": "/api/v2/shop/payment-methods{?paymentId,tokenValue}",
"hydra:template": "\/api\/v2\/shop\/payment-methods{?paymentId,tokenValue}",
"hydra:variableRepresentation": "BasicRepresentation",
"hydra:mapping": [
{
"@type": "IriTemplateMapping",
"variable": "paymentId",
"property": null,
"required": false
},
{
"@type": "IriTemplateMapping",
"variable": "tokenValue",
"property": null,
"required": false
}
]
}
{
"@type": "IriTemplateMapping",
"variable": "paymentId",
"property": null,
"required": false
},
{
"@type": "IriTemplateMapping",
"variable": "tokenValue",
"property": null,
"required": false
}
]
}
}

View file

@ -22,26 +22,36 @@
"name": "Bank transfer",
"description": @string@,
"instructions": null
},
{
"@id": "\/api\/v2\/shop\/payment-methods\/PAYPAL",
"@type": "PaymentMethod",
"id": @integer@,
"code": "PAYPAL",
"position": 3,
"name": "PayPal",
"description": @string@,
"instructions": null
}
],
"hydra:totalItems": 2,
"hydra:search": {
"@type": "hydra:IriTemplate",
"hydra:template": "/api/v2/shop/payment-methods{?paymentId,tokenValue}",
"hydra:variableRepresentation": "BasicRepresentation",
"hydra:mapping": [
{
"@type": "IriTemplateMapping",
"variable": "paymentId",
"property": null,
"required": false
},
{
"@type": "IriTemplateMapping",
"variable": "tokenValue",
"property": null,
"required": false
}
]
}
"hydra:totalItems": 3,
"hydra:search": {
"@type": "hydra:IriTemplate",
"hydra:template": "\/api\/v2\/shop\/payment-methods{?paymentId,tokenValue}",
"hydra:variableRepresentation": "BasicRepresentation",
"hydra:mapping": [
{
"@type": "IriTemplateMapping",
"variable": "paymentId",
"property": null,
"required": false
},
{
"@type": "IriTemplateMapping",
"variable": "tokenValue",
"property": null,
"required": false
}
]
}
}

View file

@ -29,7 +29,13 @@
"method": {
"@id": "\/api\/v2\/shop\/payment-methods\/CASH_ON_DELIVERY",
"@type": "PaymentMethod",
"name": "Cash on delivery"
"translations": {
"en_US": {
"@id": "\/api\/v2\/shop\/payment-method-translations\/@integer@",
"@type": "PaymentMethodTranslation",
"name": "Cash on delivery"
}
}
}
}
],