updating test
This commit is contained in:
@@ -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 };
|
||||
|
||||
Reference in New Issue
Block a user