diff --git a/src/Card.php b/src/Card.php index 8ce3e63c3b..6cf88ea403 100644 --- a/src/Card.php +++ b/src/Card.php @@ -239,7 +239,7 @@ public function addClickAction(Model\UserAction $action, Button $button = null, if ($isNew) { $ex = $cardDeck->sharedExecutorsContainer->getExecutorFactory()->createExecutor($action, $this); - $ex->onHook(UserAction\BasicExecutor::HOOK_AFTER_EXECUTE, \Closure::bind(function (ExecutorInterface $ex, $return, $id) use ($cardDeck, $action) { + $ex->onHook(UserAction\BasicExecutor::HOOK_AFTER_EXECUTE, \Closure::bind(function (ExecutorInterface $ex, $return, $id) use ($cardDeck, $action) { // @phpstan-ignore-line return $cardDeck->jsExecute($return, $action); }, null, CardDeck::class)); diff --git a/src/CardDeck.php b/src/CardDeck.php index 5733416fd6..e141b3eb43 100644 --- a/src/CardDeck.php +++ b/src/CardDeck.php @@ -223,7 +223,8 @@ protected function initActionExecutor(Model\UserAction $action): ExecutorInterfa protected function jsExecute($return, Model\UserAction $action): JsBlock { if (is_string($return)) { - // hack to test reload with read only demos + // hack to test reload with read only demos, the reload is fired in separate AJAX request, + // thus the changes cannot be tested with Behat, as reverted in the first request if (str_ends_with($return, 'was executed. In demo mode all changes are reverved.')) { return $this->jsModelReturn($action, $return); } diff --git a/tests-behat/card-deck.feature b/tests-behat/card-deck.feature index 668dd69d61..329a47c15f 100644 --- a/tests-behat/card-deck.feature +++ b/tests-behat/card-deck.feature @@ -29,5 +29,6 @@ Feature: CardDeck Then I press button "Delete" Then I press Modal button "Ok" Then Toast display should contain text 'Country action "delete" with "United Kingdom" entity was executed.' - # TODO https://github.com/atk4/ui/issues/1848 + # TODO CardDeck reload is fired in separate AJAX request, thus the changes + # cannot be tested with Behat, as reverted in the first request # Then I should not see "United Kingdom"