Skip to content

Commit

Permalink
Add test for lower bound on chart height
Browse files Browse the repository at this point in the history
  • Loading branch information
jantoun-scottlogic committed Jun 20, 2024
1 parent a93c77e commit f7e41db
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/app/carbon-estimation/carbon-estimation.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,17 @@ describe('CarbonEstimationComponent', () => {
});
});

it('should have a chart height of 300 for small innerHeight values (if screen height is large enough)', () => {
spyOn(component.chart as ChartComponent, 'updateOptions');
spyOnProperty(component.detailsPanel.nativeElement, 'clientHeight').and.returnValue(200);

component.onResize(100, 1000, 2000);

expect(component.chart?.updateOptions).toHaveBeenCalledOnceWith({
chart: { height: 300 },
});
});

it('should call onResize when onExpansion is called', () => {
spyOn(component, 'onResize');

Expand Down

0 comments on commit f7e41db

Please sign in to comment.