Commit b5ad2ebe by Ryan McKinley Committed by GitHub

Typo: fix threshodsWithoutKey (#18228)

parent ea0cee4c
import React, { ChangeEvent } from 'react'; import React, { ChangeEvent } from 'react';
import { mount } from 'enzyme'; import { mount } from 'enzyme';
import { ThresholdsEditor, Props, threshodsWithoutKey } from './ThresholdsEditor'; import { ThresholdsEditor, Props, thresholdsWithoutKey } from './ThresholdsEditor';
import { colors } from '../../utils'; import { colors } from '../../utils';
const setup = (propOverrides?: Partial<Props>) => { const setup = (propOverrides?: Partial<Props>) => {
...@@ -21,7 +21,7 @@ const setup = (propOverrides?: Partial<Props>) => { ...@@ -21,7 +21,7 @@ const setup = (propOverrides?: Partial<Props>) => {
}; };
function getCurrentThresholds(editor: ThresholdsEditor) { function getCurrentThresholds(editor: ThresholdsEditor) {
return threshodsWithoutKey(editor.state.thresholds); return thresholdsWithoutKey(editor.state.thresholds);
} }
describe('Render', () => { describe('Render', () => {
......
...@@ -155,7 +155,7 @@ export class ThresholdsEditor extends PureComponent<Props, State> { ...@@ -155,7 +155,7 @@ export class ThresholdsEditor extends PureComponent<Props, State> {
onChange = () => { onChange = () => {
const { thresholds } = this.state; const { thresholds } = this.state;
this.props.onChange(threshodsWithoutKey(thresholds)); this.props.onChange(thresholdsWithoutKey(thresholds));
}; };
renderInput = (threshold: ThresholdWithKey) => { renderInput = (threshold: ThresholdWithKey) => {
...@@ -231,7 +231,7 @@ export class ThresholdsEditor extends PureComponent<Props, State> { ...@@ -231,7 +231,7 @@ export class ThresholdsEditor extends PureComponent<Props, State> {
} }
} }
export function threshodsWithoutKey(thresholds: ThresholdWithKey[]): Threshold[] { export function thresholdsWithoutKey(thresholds: ThresholdWithKey[]): Threshold[] {
return thresholds.map(t => { return thresholds.map(t => {
const { key, ...rest } = t; const { key, ...rest } = t;
return rest; // everything except key return rest; // everything except key
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment