mirror of
https://github.com/Sylius/Sylius.git
synced 2026-07-14 17:10:53 +00:00
Cover seeing_order_aggregated_taxes.feature scenarios
This commit is contained in:
parent
83ec73fb52
commit
4bc7507e91
2 changed files with 27 additions and 2 deletions
|
|
@ -20,7 +20,7 @@ Feature: Seeing aggregated taxes of an order
|
|||
And there is a customer "charles.the.great@medieval.com" that placed an order "#00000001"
|
||||
And I am logged in as an administrator
|
||||
|
||||
@ui
|
||||
@ui @api
|
||||
Scenario: Seeing aggregated taxes of products and shipping
|
||||
Given the customer bought a single "Composite bow"
|
||||
And the customer chose "DHL" shipping method to "United States" with "Offline" payment
|
||||
|
|
@ -31,7 +31,7 @@ Feature: Seeing aggregated taxes of an order
|
|||
And the order's tax total should be "$25.30"
|
||||
And the order's total should be "$135.30"
|
||||
|
||||
@ui
|
||||
@ui @api
|
||||
Scenario: Seeing aggregated taxes of multiple products from different tax rates and shipping
|
||||
Given the customer bought a single "Composite bow"
|
||||
And the customer bought a "Claymore" and a "Bastard sword"
|
||||
|
|
|
|||
|
|
@ -495,6 +495,31 @@ final class ManagingOrdersContext implements Context
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then there should be a shipping tax :shippingTax for :shippingMethodName method
|
||||
*/
|
||||
public function thereShouldBeAShippingTaxForMethod(string $shippingTax, string $shippingMethodName): void
|
||||
{
|
||||
/** @var OrderInterface $order */
|
||||
$order = $this->sharedStorage->get('order');
|
||||
|
||||
$adjustments = $this->client->subResourceIndex(
|
||||
Resources::ORDERS,
|
||||
Resources::ADJUSTMENTS,
|
||||
$order->getTokenValue(),
|
||||
true,
|
||||
);
|
||||
|
||||
$this->responseChecker->hasItemWithValues(
|
||||
$adjustments,
|
||||
[
|
||||
'type' => AdjustmentInterface::TAX_ADJUSTMENT,
|
||||
'label' => $shippingMethodName,
|
||||
'amount' => $this->getTotalAsInt($shippingTax),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Then /^(the administrator) should see that (order placed by "[^"]+") has "([^"]+)" currency$/
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue