Skip to content

Commit

Permalink
fix: [M3-8937] - Content shifting on Linode Details summary graphs (l…
Browse files Browse the repository at this point in the history
…inode#11301)

* fix styles

* fix more

* clean up

* changeset

* fix graph component regression

* fix breakpoint issues

---------

Co-authored-by: Banks Nussman <banks@nussman.us>
  • Loading branch information
bnussman-akamai and bnussman authored Nov 25, 2024
1 parent 1b0733f commit f16fa7e
Show file tree
Hide file tree
Showing 10 changed files with 219 additions and 328 deletions.
5 changes: 5 additions & 0 deletions packages/manager/.changeset/pr-11301-fixed-1732202951516.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Fixed
---

Content shifting on Linode Details summary graphs ([#11301](https://github.com/linode/manager/pull/11301))
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ describe('Integration Tests for DBaaS Dashboard ', () => {
});

//validate the widget areachart is present
cy.findByTestId('areachart-wrapper').within(() => {
cy.get('.recharts-responsive-container').within(() => {
const expectedWidgetValues = getWidgetLegendRowValuesFromResponse(
metricsAPIResponsePayload,
testData.title,
Expand Down Expand Up @@ -326,7 +326,7 @@ describe('Integration Tests for DBaaS Dashboard ', () => {
});

//validate the widget areachart is present
cy.findByTestId('areachart-wrapper').within(() => {
cy.get('.recharts-responsive-container').within(() => {
const expectedWidgetValues = getWidgetLegendRowValuesFromResponse(
metricsAPIResponsePayload,
testData.title,
Expand Down Expand Up @@ -397,7 +397,7 @@ describe('Integration Tests for DBaaS Dashboard ', () => {
.click();
cy.get('@widget').should('be.visible');

cy.findByTestId('areachart-wrapper').within(() => {
cy.get('.recharts-responsive-container').within(() => {
const expectedWidgetValues = getWidgetLegendRowValuesFromResponse(
metricsAPIResponsePayload,
testData.title,
Expand Down Expand Up @@ -429,7 +429,7 @@ describe('Integration Tests for DBaaS Dashboard ', () => {
.scrollIntoView()
.click({ force: true });
cy.get('@widget').should('be.visible');
cy.findByTestId('areachart-wrapper').within(() => {
cy.get('.recharts-responsive-container').within(() => {
const expectedWidgetValues = getWidgetLegendRowValuesFromResponse(
metricsAPIResponsePayload,
testData.title,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ describe('Integration Tests for Linode Dashboard ', () => {
});

//validate the widget areachart is present
cy.findByTestId('areachart-wrapper').within(() => {
cy.get('.recharts-responsive-container').within(() => {
const expectedWidgetValues = getWidgetLegendRowValuesFromResponse(
metricsAPIResponsePayload,
testData.title,
Expand Down Expand Up @@ -295,7 +295,7 @@ describe('Integration Tests for Linode Dashboard ', () => {
});

//validate the widget areachart is present
cy.findByTestId('areachart-wrapper').within(() => {
cy.get('.recharts-responsive-container').within(() => {
const expectedWidgetValues = getWidgetLegendRowValuesFromResponse(
metricsAPIResponsePayload,
testData.title,
Expand Down Expand Up @@ -368,7 +368,7 @@ describe('Integration Tests for Linode Dashboard ', () => {
.should('be.enabled')
.click();
cy.get('@widget').should('be.visible');
cy.findByTestId('areachart-wrapper').within(() => {
cy.get('.recharts-responsive-container').within(() => {
const expectedWidgetValues = getWidgetLegendRowValuesFromResponse(
metricsAPIResponsePayload,
testData.title,
Expand Down Expand Up @@ -401,7 +401,7 @@ describe('Integration Tests for Linode Dashboard ', () => {
.click({ force: true });
cy.get('@widget').should('be.visible');

cy.findByTestId('areachart-wrapper').within(() => {
cy.get('.recharts-responsive-container').within(() => {
const expectedWidgetValues = getWidgetLegendRowValuesFromResponse(
metricsAPIResponsePayload,
testData.title,
Expand Down
4 changes: 2 additions & 2 deletions packages/manager/src/components/AreaChart/AreaChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ export const AreaChart = (props: AreaChartProps) => {
};

return (
<Box data-testid="areachart-wrapper">
<>
<ResponsiveContainer height={height} width={width}>
<_AreaChart aria-label={ariaLabel} data={data} margin={margin}>
<CartesianGrid
Expand Down Expand Up @@ -333,7 +333,7 @@ export const AreaChart = (props: AreaChartProps) => {
timezone={timezone}
unit={unit}
/>
</Box>
</>
);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,13 @@ import LinodeSummary from './LinodeSummary';

describe('LinodeSummary', () => {
it('should have a select menu for the graphs', () => {
const { getByText } = renderWithTheme(
const { getByDisplayValue } = renderWithTheme(
<MemoryRouter initialEntries={['linode/1']}>
<Route path="linode/:linodeId">
<LinodeSummary
isBareMetalInstance={false}
linodeCreated="2018-11-01T00:00:00"
/>
<LinodeSummary linodeCreated="2018-11-01T00:00:00" />
</Route>
</MemoryRouter>
);
expect(getByText('Last 24 Hours')).toBeInTheDocument();
expect(getByDisplayValue('Last 24 Hours')).toBeInTheDocument();
});
});
Loading

0 comments on commit f16fa7e

Please sign in to comment.