Skip to content
Merged
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 @@ -291,7 +291,7 @@ public function testScoreSettingsSectionSummary(): void

$i1_1_4_1 = $this->getFormWrappedHtml(
'date-time-field-input',
'tst_reporting_date<span class="asterisk" aria-label="required_field">*</span>',
'tst_reporting_date<span class="sr-only">required_field</span><span class="asterisk" aria-hidden="true">*</span>',
'<div class="c-input-group">
<input id="id_6" type="datetime-local" class="c-field-datetime" />
</div>',
Expand All @@ -303,7 +303,7 @@ public function testScoreSettingsSectionSummary(): void

$i1_1_4 = $this->getFormWrappedHtml(
'group-field-input',
'<input type="radio" id="id_5" value="3" /><span>tst_results_access_date</span><span class="asterisk" aria-label="required_field">*</span>',
'<input type="radio" id="id_5" value="3" /><span>tst_results_access_date</span><span class="sr-only">required_field</span><span class="asterisk" aria-hidden="true">*</span>',
$i1_1_4_1,
'tst_results_access_date_desc',
'id_5',
Expand All @@ -313,7 +313,7 @@ public function testScoreSettingsSectionSummary(): void

$i1_1 = $this->getFormWrappedHtml(
'switchable-group-field-input',
'tst_results_access_setting<span class="asterisk" aria-label="required_field">*</span>',
'tst_results_access_setting<span class="sr-only">required_field</span><span class="asterisk" aria-hidden="true">*</span>',
$i1_1_1 . $i1_1_2 . $i1_1_3 . $i1_1_4,
null,
null,
Expand Down Expand Up @@ -441,7 +441,7 @@ public function testScoreSettingsSectionGamification(): void

$fields = $this->getFormWrappedHtml(
'radio-field-input',
'tst_highscore_mode<span class="asterisk" aria-label="required_field">*</span>',
'tst_highscore_mode<span class="sr-only">required_field</span><span class="asterisk" aria-hidden="true">*</span>',
'<div class="c-field-radio">
<div class="c-field-radio__item">
<input type="radio" id="id_2_1_opt" value="1" /><label for="id_2_1_opt">tst_highscore_own_table</label><div class="c-input__help-byline">tst_highscore_own_table_description</div>
Expand All @@ -460,7 +460,7 @@ public function testScoreSettingsSectionGamification(): void
);
$fields .= $this->getFormWrappedHtml(
'numeric-field-input',
'tst_highscore_top_num<span class="asterisk" aria-label="required_field">*</span>',
'tst_highscore_top_num<span class="sr-only">required_field</span><span class="asterisk" aria-hidden="true">*</span>',
'<input id="id_3" type="number" step="1" value="10" class="c-field-number" />',
'tst_highscore_top_num_description',
'id_3',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<fieldset class="c-input" data-il-ui-component="{UI_COMPONENT_NAME}" data-il-ui-input-name="{INPUT_NAME}"<!-- BEGIN disabled --> disabled="disabled"<!-- END disabled --><!-- BEGIN described --> aria-describedby="{ERROR_ID}"<!-- END described --><!-- BEGIN binding --> id="{BINDING_ID}"<!-- END binding --><!-- BEGIN tabindex --> tabindex="0"<!-- END tabindex -->>

<label <!-- BEGIN for --> for="{ID}"<!-- END for -->>{LABEL}<!-- BEGIN required --><span class="asterisk" aria-label="{REQUIRED_ARIA}">*</span><!-- END required --></label>
<label <!-- BEGIN for --> for="{ID}"<!-- END for -->>{LABEL}<!-- BEGIN required --><span class="sr-only">{REQUIRED_ARIA}</span><span class="asterisk" aria-hidden="true">*</span><!-- END required --></label>

<div class="c-input__field">
{INPUT}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ public function testStandardFormRenderWithRequired(): void

$field_html = $this->getFormWrappedHtml(
'text-field-input',
'label<span class="asterisk" aria-label="required_field">*</span>',
'label<span class="sr-only">required_field</span><span class="asterisk" aria-hidden="true">*</span>',
'<input id="id_1" type="text" name="form/input_0" class="c-field-text" />',
'byline',
'id_1',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ protected function testWithError(FormInput $component): void

protected function testWithRequired(FormInput $component): void
{
$expected = '<span class="asterisk" aria-label="required_field">*</span></label>';
$expected = '<span class="sr-only">required_field</span><span class="asterisk" aria-hidden="true">*</span></label>';
$this->assertStringContainsString($expected, $this->render($component->withRequired(true)));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ public function testRenderWithRequired(): void
$expected = $this->brutallyTrimHTML(
"
<fieldset class=\"c-input\" data-il-ui-component=\"markdown-field-input\" data-il-ui-input-name=\"name_0\" id=\"id_8\" tabindex=\"0\">
<label>$label<span class=\"asterisk\" aria-label=\"required_field\">*</span></label>
<label>$label<span class=\"sr-only\">required_field</span><span class=\"asterisk\" aria-hidden=\"true\">*</span></label>
<div class=\"c-input__field\">

<div class=\"c-field-markdown\">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ public function testRenderWithRequired(): void
$renderer = $this->getDefaultRenderer();

$expected_html = <<<HTML
<label for="id_2"><span class="asterisk" aria-label="required_field">*</span></label>
<label for="id_2"><span class="sr-only">required_field</span><span class="asterisk" aria-hidden="true">*</span></label>
HTML;

$actual_html = $renderer->render($component);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ public function testRenderWithRequired(): void
$renderer = $this->getDefaultRenderer();

$expected_html = <<<HTML
<label for="id_2"><span class="asterisk" aria-label="required_field">*</span></label>
<label for="id_2"><span class="sr-only">required_field</span><span class="asterisk" aria-hidden="true">*</span></label>
HTML;

$actual_html = $renderer->render($component);
Expand Down