Skip to content

Commit

Permalink
fix stan, improve test
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek committed Oct 19, 2022
1 parent 89beeb7 commit d56cc05
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion demos/interactive/modal.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@
$stepModal->addButtonAction($action);

// Set modal functionality. Will changes content according to page being displayed.
$stepModal->set(function (View $p) use ($stepModal, $session, $prevAction, $nextAction) {
$stepModal->set(function (View $p) use ($session, $prevAction, $nextAction) {
$page = $session->recall('page', 1);
$success = $session->recall('success', false);
if (isset($_GET['move'])) {
Expand Down
3 changes: 2 additions & 1 deletion src/Behat/Context.php
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,8 @@ public function iClickCloseModal(): void
*/
public function iHideJsModal(): void
{
$this->getSession()->executeScript('$(".modal.active.front").modal("hide")');
$modal = $this->findElement(null, '.modal.visible.active.front');
$this->getSession()->executeScript('$(arguments[0]).modal("hide")', [$modal]);
}

// }}}
Expand Down
4 changes: 4 additions & 0 deletions tests-behat/form.feature
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ Feature: Form
When I press Modal button "Save"
Then Modal is open with text "Atk4\Core\Exception: Test exception II."
Then I hide js modal
Then I hide js modal
When I press button "Modal Test"
When I press Modal button "Save"
Then Modal is open with text "Atk4\Core\Exception: Test exception II."
Then I hide js modal
When I press Modal button "Save"
Then Modal is open with text "Atk4\Core\Exception: Test exception II."

0 comments on commit d56cc05

Please sign in to comment.