このコミットが含まれているのは:
@@ -28,6 +28,7 @@ class CountsPivotLayout
|
||||
result = []
|
||||
values.each_with_index do |tuple, index|
|
||||
result << { values: tuple, kind: 'data' }
|
||||
# A group continuing on the next page closes only on its final page.
|
||||
following = values[index + 1] || next_values
|
||||
depths.reverse_each do |depth|
|
||||
prefix = tuple.first(depth)
|
||||
|
||||
@@ -45,17 +45,28 @@ RSpec.describe 'Counts masked pivot contracts' do
|
||||
end
|
||||
|
||||
it 'preserves monthly name subtotals and grand totals across pages' do
|
||||
settings = { 'resource' => 'tags', 'rows' => 'created_at:month name_ja' }
|
||||
settings = { 'resource' => 'tags', 'rows' => 'created_at:month name' }
|
||||
complete = result(admin, settings)
|
||||
paged = result(admin, settings.merge('limit' => '1'))
|
||||
expect(complete[:group_count]).to eq(3)
|
||||
expect(grand(complete)).to eq(3)
|
||||
expect(grand(paged)).to eq(3)
|
||||
subtotal = paged[:pivot_totals].find do |cell|
|
||||
cell[:row] == ['2023-01'] && cell[:column].empty?
|
||||
(1..3).each do |page|
|
||||
paged = result(admin, settings.merge('limit' => '1', 'page' => page.to_s))
|
||||
expect(grand(paged)).to eq(3)
|
||||
subtotal = paged[:pivot_totals].find do |cell|
|
||||
cell[:row] == ['2023-01'] && cell[:column].empty?
|
||||
end
|
||||
headers = paged[:row_headers].select { _1[:kind] == 'subtotal' }
|
||||
if page == 3
|
||||
expect(headers.map { _1[:values] }).to eq([['2023-01']])
|
||||
expect(subtotal).not_to be_nil
|
||||
expect(subtotal[:count]).to eq(3)
|
||||
else
|
||||
expect(headers).to eq([])
|
||||
expect(subtotal).to be_nil
|
||||
end
|
||||
expect(paged[:cells].sum { _1[:count] }).to eq(1)
|
||||
expect(paged[:group_count]).to eq(3)
|
||||
end
|
||||
expect(subtotal[:count]).to eq(3)
|
||||
expect(paged[:cells].sum { _1[:count] }).to eq(1)
|
||||
end
|
||||
|
||||
it 'preserves five tag occurrences after merging private tags and across pages' do
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする