Use a caption to identify budget phases table
This makes the table easier to identify when writing tests and using screen readers. Since we do not render any other table captions anywhere else, we're making the caption invisible so only screen reader users will be affected by this change.
This commit is contained in:
@@ -212,6 +212,10 @@ $table-header: #ecf1f6;
|
|||||||
|
|
||||||
table {
|
table {
|
||||||
|
|
||||||
|
caption {
|
||||||
|
@include element-invisible;
|
||||||
|
}
|
||||||
|
|
||||||
thead {
|
thead {
|
||||||
|
|
||||||
&,
|
&,
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
<% if phases.present? %>
|
<% if phases.present? %>
|
||||||
<table id="budget-phases-table" class="budget-phases-table table-for-mobile">
|
<table class="budget-phases-table table-for-mobile">
|
||||||
|
<caption><%= t("admin.budgets.edit.phases_caption") %></caption>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th><%= t("admin.budgets.edit.phase") %></th>
|
<th><%= t("admin.budgets.edit.phase") %></th>
|
||||||
|
|||||||
@@ -94,6 +94,7 @@ en:
|
|||||||
publish: "Publish budget"
|
publish: "Publish budget"
|
||||||
delete: Delete budget
|
delete: Delete budget
|
||||||
phase: Phase
|
phase: Phase
|
||||||
|
phases_caption: "Phases"
|
||||||
dates: Dates
|
dates: Dates
|
||||||
enabled: Enabled
|
enabled: Enabled
|
||||||
actions: Actions
|
actions: Actions
|
||||||
|
|||||||
@@ -94,6 +94,7 @@ es:
|
|||||||
publish: "Publicar presupuesto"
|
publish: "Publicar presupuesto"
|
||||||
delete: Eliminar presupuesto
|
delete: Eliminar presupuesto
|
||||||
phase: Fase
|
phase: Fase
|
||||||
|
phases_caption: "Fases"
|
||||||
dates: Fechas
|
dates: Fechas
|
||||||
enabled: Habilitada
|
enabled: Habilitada
|
||||||
actions: Acciones
|
actions: Acciones
|
||||||
|
|||||||
@@ -255,7 +255,7 @@ describe "Admin budgets", :admin do
|
|||||||
|
|
||||||
expect(page).to have_select "Phase", selected: "Selecting projects"
|
expect(page).to have_select "Phase", selected: "Selecting projects"
|
||||||
|
|
||||||
expect(page).to have_table "budget-phases-table", with_cols: [
|
expect(page).to have_table "Phases", with_cols: [
|
||||||
[
|
[
|
||||||
"Information",
|
"Information",
|
||||||
"Accepting projects",
|
"Accepting projects",
|
||||||
@@ -278,7 +278,7 @@ describe "Admin budgets", :admin do
|
|||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
|
||||||
within_table "budget-phases-table" do
|
within_table "Phases" do
|
||||||
within "tr", text: "Information" do
|
within "tr", text: "Information" do
|
||||||
expect(page).to have_css ".budget-phase-enabled.enabled"
|
expect(page).to have_css ".budget-phase-enabled.enabled"
|
||||||
expect(page).to have_link "Edit phase"
|
expect(page).to have_link "Edit phase"
|
||||||
|
|||||||
Reference in New Issue
Block a user