Skip to content

Commit d3dfc52

Browse files
committed
add integration test
1 parent 5435634 commit d3dfc52

File tree

1 file changed

+30
-0
lines changed
  • dev/tests/integration/testsuite/Magento/Sales/Block/Adminhtml/Order

1 file changed

+30
-0
lines changed

dev/tests/integration/testsuite/Magento/Sales/Block/Adminhtml/Order/TotalsTest.php

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,36 @@ public function testTotalsInclTax(): void
7272
$this->assertShipping($blockTotals->toHtml(), (float) $order->getShippingInclTax());
7373
}
7474

75+
/**
76+
* Test block totals including canceled amount.
77+
*
78+
* @magentoDataFixture Magento/Sales/_files/order.php
79+
*
80+
* @return void
81+
*/
82+
public function testTotalCanceled(): void
83+
{
84+
$order = $this->orderFactory->create()->loadByIncrementId('100000001');
85+
$order->cancel();
86+
$blockTotals = $this->getBlockTotals()->setOrder($order);
87+
$this->assertCanceled($blockTotals->toHtml(), $order->getTotalCanceled());
88+
}
89+
90+
/**
91+
* Check if canceled amount present in block.
92+
*
93+
* @param string $blockTotalsHtml
94+
* @param float $amount
95+
* @return void
96+
*/
97+
private function assertCanceled(string $blockTotalsHtml, float $amount): void
98+
{
99+
$this->assertTrue(
100+
$this->isBlockContainsTotalAmount($blockTotalsHtml, __('Total Canceled'), $amount),
101+
'Canceled amount is missing or incorrect.'
102+
);
103+
}
104+
75105
/**
76106
* Check if subtotal amount present in block.
77107
*

0 commit comments

Comments
 (0)