MDL-70829 mod_data: Mark up decorative images properly

* Decorative images should have an empty alt text and there's no need
to set a presentation role.
* Accessibility Behat tests added to cover the changes
This commit is contained in:
Jun Pataleta 2024-03-18 20:58:27 +08:00
parent 91837d0553
commit 04ec43be5e
No known key found for this signature in database
GPG Key ID: F83510526D99E2C7
4 changed files with 23 additions and 13 deletions

View File

@ -55,14 +55,8 @@
}
}}
<div class="text-xs-center text-center mt-4" data-region="empty-message">
<img
src="{{noitemsimgurl}}"
alt="{{#str}} norecords, mod_data {{/str}}"
role="presentation"
style="height: 70px; width: 70px;"
>
<img src="{{noitemsimgurl}}" alt="" style="height: 70px; width: 70px;">
<h5 class="h5 mt-3 mb-0">{{#str}} norecords, mod_data {{/str}}</h5>
<div class="mt-5 mb-0" id="action_bar">
{{#importentriesbutton}}
{{> core/single_button }}

View File

@ -71,12 +71,7 @@
}
}}
<div class="text-xs-center text-center mt-4" data-region="empty-message">
<img
src="{{noitemsimgurl}}"
alt="{{{ title }}}"
role="presentation"
style="height: 70px; width: 70px;"
>
<img src="{{noitemsimgurl}}" alt="" style="height: 70px; width: 70px;">
<h5 class="h5 mt-3 mb-0">{{{ title }}}</h5>
{{#intro}}
<p class="mt-3 mb-0">{{{ intro }}}</p>

View File

@ -183,3 +183,18 @@ Feature: Users can view and search database entries
| param1 | param3 | autolink |
| 0 | 0 | should not |
| 1 | 1 | should |
@javascript @accessibility
Scenario: Check the accessibility of the database entries page (zero state)
When I am on the "Test database name" "data activity" page logged in as "teacher1"
Then I should see "No entries yet"
And the page should meet accessibility standards
@javascript @accessibility
Scenario: Check the accessibility of the database entries page
Given the following "mod_data > entries" exist:
| database | user | Test field name | Test field 2 name | Test field 3 name |
| data1 | student1 | Student entry 1 | Some student content 1 | http://moodle.com |
| data1 | teacher1 | Teacher entry 2 | Some teacher content 2 | http://moodle.com |
When I am on the "Test database name" "data activity" page logged in as teacher1
Then the page should meet accessibility standards

View File

@ -65,3 +65,9 @@ Feature: Zero state page (no fields created)
Then I click on "Use this preset" "button"
And I should not see "Field mappings"
And I should see "Image" in the "image" "table_row"
@javascript @accessibility
Scenario: Check the accessibility of the database activity zero state
When I am on the "Test database name" "data activity" page logged in as "teacher1"
Then I should see "Start building your activity"
And the page should meet accessibility standards