Skip to content

Commit

Permalink
-
Browse files Browse the repository at this point in the history
  • Loading branch information
javiereguiluz committed Oct 29, 2023
1 parent 468b8a8 commit 00cb2fb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/Controller/FormFieldLabelControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public function testFieldsLabelsOnDetailPage()
static::assertSelectorTextSame('.field-group.field-published-at .field-label > div', 'PublishedAt Lorem Ipsum', 'The "publishedAt" field defines its label as a translatable string with regular text (no HTML contents).');

// fields with a label defined as a string with HTML contents
static::assertSame('<a href="https://example.com">Tab</a> <b>7</b>', trim($crawler->filter('ul.nav-tabs #tablist-tab-tab-7')->html()), 'The "Tab 7" defines its label as a text string with HTML contents, which must be rendered instead of escaped.');
static::assertSame('<span class="text-danger">Tab</span> <b>7</b>', trim($crawler->filter('ul.nav-tabs #tablist-tab-tab-7')->html()), 'The "Tab 7" defines its label as a text string with HTML contents, which must be rendered instead of escaped.');
static::assertSame('#tab-tab-7', $crawler->filter('ul.nav-tabs #tablist-tab-tab-7')->attr('href'), 'Tabs with labels get IDs generated as the slugs of their labels but HTML tags must be removed.');
static::assertSame('<a href="https://example.com">Column</a> <b>7</b>', trim($crawler->filter('.form-column.column-7 .form-column-title-content')->html()), 'The "Column 7" defines its label as a text string with HTML contents, which must be rendered instead of escaped.');
static::assertSelectorNotExists('.form-column.column-7.form-column-no-header');
Expand All @@ -176,7 +176,7 @@ public function testFieldsLabelsOnDetailPage()
static::assertSame(trim($crawler->filter('.field-group.field-author .field-label > div')->html()), '<a href="https://example.com">Author</a> <b>Lorem</b> Ipsum', 'The "author" field defines its label as regular string with HTML contents, which must be rendered instead of escaped (HTML is allowed in field labels).');

// fields with a label defined as a translatable string with HTML contents
static::assertSame('<a href="https://example.com">Tab</a> <b>8</b>', trim($crawler->filter('ul.nav-tabs #tablist-tab-tab-8')->html()), 'The "Tab 8" defines its label as a translatable string with HTML contents, which must be rendered instead of escaped.');
static::assertSame('<span class="text-danger">Tab</span> <b>8</b>', trim($crawler->filter('ul.nav-tabs #tablist-tab-tab-8')->html()), 'The "Tab 8" defines its label as a translatable string with HTML contents, which must be rendered instead of escaped.');
static::assertSame('#tab-tab-8', $crawler->filter('ul.nav-tabs #tablist-tab-tab-8')->attr('href'), 'Tabs with labels get IDs generated as the slugs of their labels but HTML tags must be removed.');
static::assertSame('<a href="https://example.com">Column</a> <b>8</b>', trim($crawler->filter('.form-column.column-8 .form-column-title-content')->html()), 'The "Column 8" defines its label as a translatable string with HTML contents, which must be rendered instead of escaped.');
static::assertSelectorNotExists('.form-column.column-8.form-column-no-header');
Expand Down

0 comments on commit 00cb2fb

Please sign in to comment.