Fixed test

This commit is contained in:
Nicolas Lœuillet 2022-06-16 15:11:32 +02:00
parent e55cb639fc
commit 5291f7fb97
2 changed files with 7 additions and 2 deletions

View File

@ -26,7 +26,7 @@
<i class="material-icons">mode_edit</i>
</a>
{% endif %}
<a href="{{ path('tag_delete', {'slug': tag.slug})}}" class="card-tag-icon card-tag-delete" onclick="return confirm('{{ 'tag.confirm.delete'|trans({'%name%': tag.label})|escape('js') }}')">
<a id="delete-{{ tag.slug }}" href="{{ path('tag_delete', {'slug': tag.slug})}}" class="card-tag-icon card-tag-delete" onclick="return confirm('{{ 'tag.confirm.delete'|trans({'%name%': tag.label})|escape('js') }}')">
<i class="material-icons">delete</i>
</a>
{% if app.user.config.feedToken %}

View File

@ -6,6 +6,9 @@ use Tests\Wallabag\CoreBundle\WallabagCoreTestCase;
use Wallabag\CoreBundle\Entity\Entry;
use Wallabag\CoreBundle\Entity\Tag;
/**
* @group Tag
*/
class TagControllerTest extends WallabagCoreTestCase
{
public $tagName = 'opensource';
@ -161,7 +164,9 @@ class TagControllerTest extends WallabagCoreTestCase
$this->getEntityManager()->flush();
$this->getEntityManager()->clear();
$client->request('GET', '/tag/delete/' . $tag->getSlug());
$crawler = $client->request('GET', '/tag/list');
$link = $crawler->filter('a[id="delete-' . $tag->getSlug() . '"]')->link();
$client->click($link);
$tag = $client->getContainer()
->get('doctrine.orm.entity_manager')