Skip to content

Commit

Permalink
improve comment
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek committed Feb 22, 2023
1 parent 93beb6d commit 9ed538a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Card.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));

Expand Down
3 changes: 2 additions & 1 deletion src/CardDeck.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
3 changes: 2 additions & 1 deletion tests-behat/card-deck.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit 9ed538a

Please sign in to comment.