Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

{% if last_error is not null %}
<div class="alert alert-danger" {{ sylius_test_html_attribute('invalid-credentials-message') }}>
{{ last_error.messageKey|trans }}
{{ last_error.messageKey|trans(last_error.messageData, 'security') }}
</div>
{% endif %}
35 changes: 35 additions & 0 deletions tests/Translations/FrenchTranslatedLoginTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

declare(strict_types=1);

namespace MainTests\Sylius\Translations;

use Symfony\Bundle\FrameworkBundle\KernelBrowser;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Zenstruck\Foundry\Attribute\ResetDatabase;

#[ResetDatabase]
final class FrenchTranslatedLoginTest extends WebTestCase
{
use MarkTestSkippedTrait;

private KernelBrowser $client;

protected function setUp(): void
{
$this->client = static::createClient();
}

public function testInvalidCredentialsMessageIsTranslated(): void
{
$this->markTestSkippedIfNecessary('fr');

$this->client->request('POST', '/admin/login_check', [
'_username' => 'nonexistent@example.com',
'_password' => 'wrong-password',
]);
$this->client->followRedirect();

self::assertSelectorTextContains('[data-test-invalid-credentials-message]', 'Identifiants invalides.');
}
}
Loading