mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
fix: don't count falses in summary (#589)
This commit is contained in:
parent
71c6537c49
commit
ab6807c342
@ -244,7 +244,7 @@ export class SelectionSummary extends Disposable {
|
|||||||
} else {
|
} else {
|
||||||
for (const i of rowIndices) {
|
for (const i of rowIndices) {
|
||||||
const value = values[i];
|
const value = values[i];
|
||||||
if (value !== null && value !== undefined && value !== '' && !isEmpty?.(value)) {
|
if (value !== null && value !== undefined && value !== '' && value !== false && !isEmpty?.(value)) {
|
||||||
countNonEmpty++;
|
countNonEmpty++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -130,11 +130,6 @@ describe('SelectionSummary', function () {
|
|||||||
count: 2,
|
count: 2,
|
||||||
sum: null,
|
sum: null,
|
||||||
});
|
});
|
||||||
await selectAndAssert({col: 2, row: 0}, {col: 3, row: 5}, {
|
|
||||||
dimensions: '6⨯2',
|
|
||||||
count: 11,
|
|
||||||
sum: null,
|
|
||||||
});
|
|
||||||
|
|
||||||
// Scroll horizontally to the end of the table.
|
// Scroll horizontally to the end of the table.
|
||||||
await gu.sendKeys(Key.END);
|
await gu.sendKeys(Key.END);
|
||||||
@ -151,6 +146,15 @@ describe('SelectionSummary', function () {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('does not count false values', async function () {
|
||||||
|
// False values in boolean columns should not be included in count
|
||||||
|
await selectAndAssert({col: 2, row: 0}, {col: 3, row: 5}, {
|
||||||
|
dimensions: '6⨯2',
|
||||||
|
count: 9,
|
||||||
|
sum: null,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
it('uses the show column of reference columns for computations', async function () {
|
it('uses the show column of reference columns for computations', async function () {
|
||||||
// Column 6 is a Reference column pointing to column 0.
|
// Column 6 is a Reference column pointing to column 0.
|
||||||
await gu.sendKeys(Key.HOME);
|
await gu.sendKeys(Key.HOME);
|
||||||
|
Loading…
Reference in New Issue
Block a user