Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

/tests/TestApplication/.env.local
/tests/TestApplication/.env.*.local
/var/

phpspec.yml

Expand Down
2 changes: 1 addition & 1 deletion features/refunding_single_order_unit.feature
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Feature: Refunding a single order unit
@ui
Scenario: Not being able to refund unit from an order that is unpaid
When I am viewing the summary of the order "#00000022"
Then I should see disabled refunds button
Then I should not see refunds button

@application
Scenario: Not being able to refund unit from an order that is unpaid
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
{% set order = hookable_metadata.context.resource %}
{% set path = path('sylius_refund_order_refunds_list', {'orderNumber': order.number,}) %}

<a class="dropdown-item {% if not can_refund_order(order.number) %}disabled{% endif %}" href="{{ path }}" {{ sylius_test_html_attribute('refunds') }}>
{{ ux_icon('tabler:repeat', {'class': 'icon dropdown-item-icon'}) }}
{{ 'sylius_refund.ui.refunds'|trans }}
</a>
{% if can_refund_order(order.number) %}
{% set path = path('sylius_refund_order_refunds_list', {'orderNumber': order.number,}) %}

<a class="dropdown-item" href="{{ path }}" {{ sylius_test_html_attribute('refunds') }}>
{{ ux_icon('tabler:repeat', {'class': 'icon dropdown-item-icon'}) }}
{{ 'sylius_refund.ui.refunds'|trans }}
</a>
{% endif %}
4 changes: 1 addition & 3 deletions tests/Behat/Context/Ui/ManagingOrdersContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ public function shouldBeNotifiedThatTheOrderShouldBePaid(): void
);
}

/**
* @Then I should not see refunds button
*/
#[Then('I should not see refunds button')]
public function iShouldNotSeeRefundsButton(): void
{
Assert::false($this->showPage->hasRefundsButton());
Expand Down
2 changes: 1 addition & 1 deletion tests/Behat/Page/Admin/Order/ShowPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function hasDownloadCreditMemoButton(int $index): bool

public function hasRefundsButton(): bool
{
return $this->getDocument()->hasButton('Refunds');
return $this->getDocument()->has('css', '[data-test-refunds]');
}

public function hasDisabledRefundsButton(): bool
Expand Down
Loading