Skip to content

Commit 774148e

Browse files
author
alina.koptyaeva
committed
fix remarks after review
1 parent c332f92 commit 774148e

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/components/Simulations/Simulation/Simulation.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ import {
4949
getResponseHeaderStateList,
5050
getTransitionStateList,
5151
getVerificationFields,
52-
isFiledsError,
52+
isFieldsError,
5353
mergeBodyStateToCurrentPair,
5454
mergeCurrentStateToMainState,
5555
mergeHeaderStateToCurrentPair,
@@ -188,7 +188,7 @@ const Simulation: React.FC<ISimulationProps> = ({ onBack, onChange, onDelete })
188188

189189
function handleBlurCurrentResponse(errorName: keyof SimulationFieldsErrorState) {
190190
return (e: InputFocus) => {
191-
const isFieldError: boolean = isFiledsError(errorName, e.target.value);
191+
const isFieldError: boolean = isFieldsError(errorName, e.target.value);
192192

193193
if (isFieldError) {
194194
setFieldsError(prev => ({ ...prev, [errorName]: FIELDS_ERROR[errorName] }));

src/components/Simulations/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export const STATUS_CODES: Array<ISelectItem<number>> = [
7676
];
7777

7878
export const FIELDS_ERROR: SimulationFieldsErrorState = {
79-
statusCode: 'Response status code is not valid. Status code should between 100 and 600',
79+
statusCode: 'Response status code is not valid. Status code should between 100 and 599',
8080
};
8181

8282
export const STATUS_CODE_VALID_VALUE = {

src/components/Simulations/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,14 +291,14 @@ export const addOrRemoveEl = <T>(list: T[], data: { add: T; remove?: number }):
291291
return newList;
292292
};
293293

294-
export const isFiledsError = (errorName: keyof SimulationFieldsErrorState, value: string): boolean => {
294+
export const isFieldsError = (errorName: keyof SimulationFieldsErrorState, value: string): boolean => {
295295
switch (errorName) {
296296
case 'statusCode': {
297297
const { minValue, maxValue } = STATUS_CODE_VALID_VALUE;
298298

299299
const numberValue: number = convertStringToInteger(value);
300300

301-
return numberValue < minValue || numberValue > maxValue;
301+
return numberValue < minValue || numberValue >= maxValue;
302302
}
303303
default:
304304
return true;

0 commit comments

Comments
 (0)