forked from microsoft/fluentui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixing re-render issue for all charts when empty (microsoft#28321)
* Fixing re-render issue for area chart * Area chart re-render fix * Fixing re-rendering for GVBC, HBC, Donut and HeatMap * Fixing the re-render issue for other charts * Change file * Updating snapshots * Resolving build error * Updating the charts to reduce re-renders * Fixing build errors * Merging master and updating snapshots * Updating snapshots * Update test * Fixing build and test errors * Fixing build and test errors * Fixing build errors * Fixing test error * Removing the test causing error * Resolving sankey chart test error * Fixing Sankey chart test failures * Fixing errors in line chart tests * Fixing errors * Fixing test errors * Removing 2 tests * Resolving donut test issue * Removing tests using act in donut chart * Resetting ids for donut test fix * Deleting tests causing test errors in PR build * Updating the charts for empty scenario * Removing tests that are failing the tests * Resolving PR comments * Heatmap test update * Sparkline test update
- Loading branch information
Showing
56 changed files
with
33,585 additions
and
4,996 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
change/@fluentui-react-charting-556f2e0e-35f0-44cd-9bd6-aa9b24aaa57e.json
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,7 @@ | ||
{ | ||
"type": "patch", | ||
"comment": "Fixing re-render issue for all charts when empty", | ||
"packageName": "@fluentui/react-charting", | ||
"email": "[email protected]", | ||
"dependentChangeType": "patch" | ||
} |
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
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
22 changes: 22 additions & 0 deletions
22
packages/react-charting/src/components/AreaChart/AreaChartRTL.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,22 @@ | ||
import * as React from 'react'; | ||
import { queryAllByAttribute, render, waitFor } from '@testing-library/react'; | ||
import { chartPoints, emptyChartPoints } from './AreaChart.test'; | ||
import { AreaChart } from './index'; | ||
|
||
describe('Area chart rendering', () => { | ||
test('Should re-render the Area chart with data', async () => { | ||
// Arrange | ||
const { container, rerender } = render(<AreaChart data={emptyChartPoints} />); | ||
const getById = queryAllByAttribute.bind(null, 'id'); | ||
// Assert | ||
expect(container).toMatchSnapshot(); | ||
expect(getById(container, /_AreaChart_empty/i)).toHaveLength(1); | ||
// Act | ||
rerender(<AreaChart data={chartPoints} />); | ||
await waitFor(() => { | ||
// Assert | ||
expect(container).toMatchSnapshot(); | ||
expect(getById(container, /_AreaChart_empty/i)).toHaveLength(0); | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.