Skip to content

Commit

Permalink
Fix actions + NavTest 2le/crudit#438 (#465)
Browse files Browse the repository at this point in the history
  • Loading branch information
valentin-helies authored Aug 28, 2024
1 parent 3269db6 commit ed39b65
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{% do action.setResource(line.resource) %}

{% set params = { 'id': line.resource.id } %}

{% if action.modal %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
{% endif %}

{% for action in group %}
{% do action.setResource(line.resource) %}

{% if action.modal %}
{% include action.modal with {action: action, id: 'modal_' ~ action.id ~ line.resource.id } %}
{% endif %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="#actions_{{ line.resource.id }}">
{% for action in view.config.actions %}
{% if action.dropdown %}
{% do action.setResource(line.resource) %}

{% if action.modal %}
{% include action.modal with {action: action, id: 'modal_' ~ action.id ~ line.resource.id } %}
{% endif %}
Expand Down
7 changes: 6 additions & 1 deletion src/Test/TestHelperTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@ protected function checkAction(Crawler $elements): void

protected function getPageTitle(): string
{
return $this->client->getCrawler()->filter('title')->first()->text();
$titleElements = $this->client->getCrawler()->filter('title');
if ($titleElements->count() > 0) {
return $titleElements->first()->text();
}

return '';
}
}

0 comments on commit ed39b65

Please sign in to comment.