Skip to content

Commit f16fa7e

Browse files
fix: [M3-8937] - Content shifting on Linode Details summary graphs (#11301)
* fix styles * fix more * clean up * changeset * fix graph component regression * fix breakpoint issues --------- Co-authored-by: Banks Nussman <banks@nussman.us>
1 parent 1b0733f commit f16fa7e

File tree

10 files changed

+219
-328
lines changed

10 files changed

+219
-328
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@linode/manager": Fixed
3+
---
4+
5+
Content shifting on Linode Details summary graphs ([#11301](https://github.com/linode/manager/pull/11301))

packages/manager/cypress/e2e/core/cloudpulse/dbaas-widgets-verification.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ describe('Integration Tests for DBaaS Dashboard ', () => {
272272
});
273273

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

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

400-
cy.findByTestId('areachart-wrapper').within(() => {
400+
cy.get('.recharts-responsive-container').within(() => {
401401
const expectedWidgetValues = getWidgetLegendRowValuesFromResponse(
402402
metricsAPIResponsePayload,
403403
testData.title,
@@ -429,7 +429,7 @@ describe('Integration Tests for DBaaS Dashboard ', () => {
429429
.scrollIntoView()
430430
.click({ force: true });
431431
cy.get('@widget').should('be.visible');
432-
cy.findByTestId('areachart-wrapper').within(() => {
432+
cy.get('.recharts-responsive-container').within(() => {
433433
const expectedWidgetValues = getWidgetLegendRowValuesFromResponse(
434434
metricsAPIResponsePayload,
435435
testData.title,

packages/manager/cypress/e2e/core/cloudpulse/linode-widget-verification.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ describe('Integration Tests for Linode Dashboard ', () => {
238238
});
239239

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

297297
//validate the widget areachart is present
298-
cy.findByTestId('areachart-wrapper').within(() => {
298+
cy.get('.recharts-responsive-container').within(() => {
299299
const expectedWidgetValues = getWidgetLegendRowValuesFromResponse(
300300
metricsAPIResponsePayload,
301301
testData.title,
@@ -368,7 +368,7 @@ describe('Integration Tests for Linode Dashboard ', () => {
368368
.should('be.enabled')
369369
.click();
370370
cy.get('@widget').should('be.visible');
371-
cy.findByTestId('areachart-wrapper').within(() => {
371+
cy.get('.recharts-responsive-container').within(() => {
372372
const expectedWidgetValues = getWidgetLegendRowValuesFromResponse(
373373
metricsAPIResponsePayload,
374374
testData.title,
@@ -401,7 +401,7 @@ describe('Integration Tests for Linode Dashboard ', () => {
401401
.click({ force: true });
402402
cy.get('@widget').should('be.visible');
403403

404-
cy.findByTestId('areachart-wrapper').within(() => {
404+
cy.get('.recharts-responsive-container').within(() => {
405405
const expectedWidgetValues = getWidgetLegendRowValuesFromResponse(
406406
metricsAPIResponsePayload,
407407
testData.title,

packages/manager/src/components/AreaChart/AreaChart.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ export const AreaChart = (props: AreaChartProps) => {
254254
};
255255

256256
return (
257-
<Box data-testid="areachart-wrapper">
257+
<>
258258
<ResponsiveContainer height={height} width={width}>
259259
<_AreaChart aria-label={ariaLabel} data={data} margin={margin}>
260260
<CartesianGrid
@@ -333,7 +333,7 @@ export const AreaChart = (props: AreaChartProps) => {
333333
timezone={timezone}
334334
unit={unit}
335335
/>
336-
</Box>
336+
</>
337337
);
338338
};
339339

packages/manager/src/features/Linodes/LinodesDetail/LinodeSummary/LinodeSummary.test.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,13 @@ import LinodeSummary from './LinodeSummary';
77

88
describe('LinodeSummary', () => {
99
it('should have a select menu for the graphs', () => {
10-
const { getByText } = renderWithTheme(
10+
const { getByDisplayValue } = renderWithTheme(
1111
<MemoryRouter initialEntries={['linode/1']}>
1212
<Route path="linode/:linodeId">
13-
<LinodeSummary
14-
isBareMetalInstance={false}
15-
linodeCreated="2018-11-01T00:00:00"
16-
/>
13+
<LinodeSummary linodeCreated="2018-11-01T00:00:00" />
1714
</Route>
1815
</MemoryRouter>
1916
);
20-
expect(getByText('Last 24 Hours')).toBeInTheDocument();
17+
expect(getByDisplayValue('Last 24 Hours')).toBeInTheDocument();
2118
});
2219
});

0 commit comments

Comments
 (0)