Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: render values that are N/A (#6633)
This change makes the tooltip still render values and headers that are `N/A` (instead of not rendering them at all). This makes the tooltip more consistent and predictable. At least to me, it was confusing that some of the values were just hidden sometimes. I've also added a test to make sure that the tooltip renders the N/A values. This is what it looks like now: ![image](https://github.com/Unleash/unleash/assets/17786332/46cb9250-6ce2-4567-a02d-b186f86c1de5)
- Loading branch information
1 parent
0c0530d
commit 990ef41
Showing
2 changed files
with
34 additions
and
18 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
...ntsChart/MetricsSummaryChart/MetricsChartTooltip/MetricsChartTooltip-InfoSummary.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { render, screen } from '@testing-library/react'; | ||
import { InfoSummary } from './MetricsChartTooltip'; | ||
|
||
test('Renders apps, flags, and environments, even when their data is `N/A`', () => { | ||
render( | ||
<InfoSummary | ||
data={[ | ||
{ key: 'Flags', value: 'N/A' }, | ||
{ key: 'Environments', value: 'N/A' }, | ||
{ key: 'Apps', value: 'N/A' }, | ||
]} | ||
/>, | ||
); | ||
|
||
screen.getByText('Environments'); | ||
screen.getByText('Apps'); | ||
screen.getByText('Flags'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters