updating test

This commit is contained in:
Peter Holmberg
2018-12-17 14:16:29 +01:00
parent ade2f297a7
commit e11834e950
2 changed files with 1 additions and 3 deletions
@@ -38,8 +38,8 @@ describe('Add threshold', () => {
instance.onAddThreshold(1);
expect(instance.state.thresholds).toEqual([
{ index: 0, value: 50, color: 'rgb(127, 115, 64)' },
{ index: 1, value: 75, color: 'rgb(170, 95, 61)' },
{ index: 0, value: 50, color: 'rgb(127, 115, 64)' },
]);
});
});
@@ -23,8 +23,6 @@ export default class Thresholds extends PureComponent<OptionModuleProps, State>
const { maxValue, minValue } = this.props.options;
const { thresholds } = this.state;
console.log('add at index:', index);
const newThresholds = thresholds.map(threshold => {
if (threshold.index >= index) {
threshold = { ...threshold, index: threshold.index + 1 };