-
Notifications
You must be signed in to change notification settings - Fork 900
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(core/serverGroup): Correct 'simple scaling' heuristic (#7385)
* fix(core/serverGroup): Correct 'simple scaling' heuristic This was seemingly introduced from 6630f9b The regression is that the "Capacity" section always considers the scaling mode to be "simple", and doesn't show the actual min/max capacity numbers, only Desired. Noticed using an AWS account. * fix(core/serverGroup): Adding test for capacity details
- Loading branch information
Showing
2 changed files
with
18 additions
and
1 deletion.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
app/scripts/modules/core/src/serverGroup/details/capacity/CapacityDetailsSection.spec.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,17 @@ | ||
import * as React from 'react'; | ||
import { mount } from 'enzyme'; | ||
|
||
import { CapacityDetailsSection } from './CapacityDetailsSection'; | ||
|
||
describe('<CapacityDetailsSection/>', function () { | ||
it('when min === max, it should be displayed in simplemode', function () { | ||
const component = mount(<CapacityDetailsSection capacity={{ min: 9, max: 9, desired: 4 }} current={5}/>); | ||
expect(component.contains(<dt>Min/Max</dt>)).toBe(true); | ||
}); | ||
|
||
it('when min !== max, it should display the different min and max separately', function () { | ||
const component = mount(<CapacityDetailsSection capacity={{ min: 1, max: 9, desired: 4 }} current={5}/>); | ||
expect(component.contains(<dt>Min</dt>)).toBe(true); | ||
expect(component.contains(<dt>Max</dt>)).toBe(true); | ||
}); | ||
}); |
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