Test pass: test_index_table_header_close_exposure
Allow closing last quantity column
This commit is contained in:
parent
a29eba9861
commit
80b10d108a
@ -59,7 +59,8 @@ module BodyTrackersHelper
|
|||||||
# * int > 0 - quantity name-labelled cell with 'int' size colspan
|
# * int > 0 - quantity name-labelled cell with 'int' size colspan
|
||||||
# * int < 0 - quantity name-labelled cell with 'int' size rowspan
|
# * int < 0 - quantity name-labelled cell with 'int' size rowspan
|
||||||
# * 0 - non-labelled cell without col-/rowspan
|
# * 0 - non-labelled cell without col-/rowspan
|
||||||
spec = []
|
spec = [Hash.new(0)]
|
||||||
|
return spec if quantities.empty?
|
||||||
default_row = Hash.new(0)
|
default_row = Hash.new(0)
|
||||||
|
|
||||||
# Determine colspans first...
|
# Determine colspans first...
|
||||||
|
@ -63,7 +63,7 @@
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<% next unless @quantities.length > 0 %>
|
<% next if @quantities.empty? %>
|
||||||
<% extra_quantities.each_slice(@quantities.length) do |eqs| %>
|
<% extra_quantities.each_slice(@quantities.length) do |eqs| %>
|
||||||
<tr class="extra <%= row_class %>" style="display:none">
|
<tr class="extra <%= row_class %>" style="display:none">
|
||||||
<% eqs.each do |q| %>
|
<% eqs.each do |q| %>
|
||||||
|
@ -15,8 +15,9 @@
|
|||||||
<% header.each_with_index do |row, i| %>
|
<% header.each_with_index do |row, i| %>
|
||||||
<tr class="header">
|
<tr class="header">
|
||||||
<% if i == 0 %>
|
<% if i == 0 %>
|
||||||
<th rowspan="<%= header.length %>"
|
<th rowspan="<%= header.length %>" style="width:<%= 2 * 100/total_width %>%">
|
||||||
style="width:<%= 2 * 100/total_width %>%"><%= l(:field_effective_from) %></th>
|
<%= l(:field_effective_from) %>
|
||||||
|
</th>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<% row.each do |q, span| %>
|
<% row.each do |q, span| %>
|
||||||
@ -83,9 +84,12 @@
|
|||||||
<%= q.name %><p class="value"><%= targets.delete(q) %></p>
|
<%= q.name %><p class="value"><%= targets.delete(q) %></p>
|
||||||
</td>
|
</td>
|
||||||
<% end %>
|
<% end %>
|
||||||
<td rowspan="<%= rows %>" class="action unwrappable"><%= action_links(date) %></td>
|
<td rowspan="<%= rows %>" class="action unwrappable">
|
||||||
|
<%= action_links(date) %>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
<% next if @quantities.empty? %>
|
||||||
<% targets.each_slice(@quantities.length) do |extras| %>
|
<% targets.each_slice(@quantities.length) do |extras| %>
|
||||||
<tr class="extra <%= row_class %>" style="display:none">
|
<tr class="extra <%= row_class %>" style="display:none">
|
||||||
<% extras.each do |q, t| %>
|
<% extras.each do |q, t| %>
|
||||||
|
@ -31,6 +31,15 @@ class TargetsTest < BodyTrackingSystemTestCase
|
|||||||
assert_selector 'table#targets thead th', text: quantities(:quantities_proteins).name
|
assert_selector 'table#targets thead th', text: quantities(:quantities_proteins).name
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_index_table_header_close_exposure
|
||||||
|
visit project_targets_path(@project1)
|
||||||
|
within 'table#targets thead th', text: quantities(:quantities_energy).name do
|
||||||
|
click_link class: 'icon-close'
|
||||||
|
end
|
||||||
|
assert_no_selector 'table#targets thead th', text: quantities(:quantities_energy).name
|
||||||
|
assert_selector 'table#targets thead th'
|
||||||
|
end
|
||||||
|
|
||||||
# TODO: rename to test_new; move checking of default values here
|
# TODO: rename to test_new; move checking of default values here
|
||||||
def test_index_show_and_hide_new_target_form
|
def test_index_show_and_hide_new_target_form
|
||||||
visit project_targets_path(@project1)
|
visit project_targets_path(@project1)
|
||||||
|
Reference in New Issue
Block a user