Fix: Bin size limit

limit bin size to 670, which craches on my computer beyong this

And added test to confirm its working
pull/18247/head
Zoe Steinkamp 2020-05-26 22:09:25 -06:00
parent 3bd249fdfc
commit 474a30e355
2 changed files with 14 additions and 1 deletions

View File

@ -129,6 +129,18 @@ describe('DataExplorer', () => {
})
})
})
it('should error when value is above "670" in bin size', () => {
cy.get('.view-options').within(() => {
cy.getByTestID('grid--column').within(() => {
cy.getByTestID('bin-size-input')
.clear()
.type('670')
.getByTestID('bin-size-input--error')
.should('have.length', 1)
})
})
})
})
describe('numeric input validation when changing number of decimal places in Single Stat', () => {

View File

@ -97,7 +97,7 @@ const HeatmapOptions: FunctionComponent<Props> = props => {
const val = convertUserInputToNumOrNaN(e)
setBinInput(val)
if (isNaN(val) || val < 5) {
if (isNaN(val) || val < 5 || val > 670) {
setBinInputStatus(ComponentStatus.Error)
return
}
@ -142,6 +142,7 @@ const HeatmapOptions: FunctionComponent<Props> = props => {
value={binInput}
type={InputType.Number}
onChange={onSetBinSize}
testID={'bin-size-input'}
/>
</Form.Element>
<h5 className="view-options--header">X Axis</h5>