Skip to content

[IGNORE] Table: test that the column unit is kept with conditional formatting - #924

Open
souvik-biswas-dev wants to merge 2 commits into
perses:mainfrom
souvik-biswas-dev:fix/table-conditional-format-keeps-unit
Open

souvik-biswas-dev wants to merge 2 commits into
perses:mainfrom
souvik-biswas-dev:fix/table-conditional-format-keeps-unit

Conversation

@souvik-biswas-dev

Copy link
Copy Markdown

Description

Adds regression tests for a Table column with format.unit: bytes and conditional cellSettings (Value and Range conditions), defined both at the column level and globally. The tests check that the unit is still applied when a condition matches.

The behaviour itself was fixed by #881 (table cell format), so this PR changes tests only and adds no code changes.

Related to perses/perses#4705.

Checklist

  • Pull request has a descriptive title and context useful to a reviewer.
  • Commits are signed off (DCO).
  • Tests added.

…rmatting

Add tests for a column with format.unit set to bytes and conditional cellSettings, defined at the column level and globally, to make sure the unit is still applied when a condition matches. This covers the behaviour fixed by the cell format change in the table plugin.

Signed-off-by: Souvik Biswas <souvikbiswas.dev@gmail.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The regression test does not verify that conditional formatting remains active, because its unit-text assertions could pass even when the conditional cell configuration is missing.

1 open issue
What changed in this PR

Adds regression tests for preserving Table byte-unit formatting when conditional cell settings are applied at the column or table level. The underlying behavior was fixed previously, and this pull request contains test-only changes.

Changes:

  • Added reusable time-series fixtures with values exercising Value and Range conditions.
  • Added coverage for unconditioned, column-level, and global conditional formatting.
  • Verified that formatted byte values render as MiB and GiB instead of raw numbers.
File Description
table/​src/​components/​TablePanel.test.tsx Adds fixtures and regression tests covering byte-unit formatting with column-level and global conditional cell settings.

Review effort: Lite

Comment on lines +659 to +663
const BYTES_CELL_CONDITIONS: NonNullable<TableOptions['cellSettings']> = [
{ condition: { kind: 'Value', spec: { value: '0' } }, textColor: '#12470c' },
{ condition: { kind: 'Range', spec: { min: 1, max: 300000000 } }, textColor: '#FFCC00' },
{ condition: { kind: 'Range', spec: { min: 300000000, max: 100000000000000 } }, textColor: '#C4162a' },
];
The unit assertions alone would also pass when no condition matches, so also check the text color of the cells for 0, 150000000 and 27487790694, and that the unconditioned column has no condition color.

Signed-off-by: Souvik Biswas <souvikbiswas.dev@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants