fix: don't count falses in summary (#589)

pull/586/head
Vincent Viers 10 months ago committed by GitHub
parent 71c6537c49
commit ab6807c342
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -244,7 +244,7 @@ export class SelectionSummary extends Disposable {
} else {
for (const i of rowIndices) {
const value = values[i];
if (value !== null && value !== undefined && value !== '' && !isEmpty?.(value)) {
if (value !== null && value !== undefined && value !== '' && value !== false && !isEmpty?.(value)) {
countNonEmpty++;
}
}

@ -130,11 +130,6 @@ describe('SelectionSummary', function () {
count: 2,
sum: null,
});
await selectAndAssert({col: 2, row: 0}, {col: 3, row: 5}, {
dimensions: '62',
count: 11,
sum: null,
});
// Scroll horizontally to the end of the table.
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: '62',
count: 9,
sum: null,
});
});
it('uses the show column of reference columns for computations', async function () {
// Column 6 is a Reference column pointing to column 0.
await gu.sendKeys(Key.HOME);

Loading…
Cancel
Save