From 814fea407aea70ed731f51dea6bc8c8ca694eaa7 Mon Sep 17 00:00:00 2001 From: Jun Pataleta Date: Mon, 18 Mar 2024 20:58:27 +0800 Subject: [PATCH] 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 --- mod/data/templates/view_noentries.mustache | 8 +------- mod/data/templates/zero_state.mustache | 7 +------ mod/data/tests/behat/view_entries.feature | 15 +++++++++++++++ mod/data/tests/behat/zero_state.feature | 6 ++++++ 4 files changed, 23 insertions(+), 13 deletions(-) diff --git a/mod/data/templates/view_noentries.mustache b/mod/data/templates/view_noentries.mustache index ae3a196f707..5a0fc957819 100644 --- a/mod/data/templates/view_noentries.mustache +++ b/mod/data/templates/view_noentries.mustache @@ -55,14 +55,8 @@ } }}
- {{#str}} norecords, mod_data {{/str}} +
{{#str}} norecords, mod_data {{/str}}
-
{{#importentriesbutton}} {{> core/single_button }} diff --git a/mod/data/templates/zero_state.mustache b/mod/data/templates/zero_state.mustache index fd65758acd1..deb4543fde0 100644 --- a/mod/data/templates/zero_state.mustache +++ b/mod/data/templates/zero_state.mustache @@ -71,12 +71,7 @@ } }}
- {{{ title }}} +
{{{ title }}}
{{#intro}}

{{{ intro }}}

diff --git a/mod/data/tests/behat/view_entries.feature b/mod/data/tests/behat/view_entries.feature index 2c014305f46..82d938d7161 100644 --- a/mod/data/tests/behat/view_entries.feature +++ b/mod/data/tests/behat/view_entries.feature @@ -191,3 +191,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 diff --git a/mod/data/tests/behat/zero_state.feature b/mod/data/tests/behat/zero_state.feature index 4d5b385d40f..8ee696ce343 100644 --- a/mod/data/tests/behat/zero_state.feature +++ b/mod/data/tests/behat/zero_state.feature @@ -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