Skip to content

Commit 231071a

Browse files
committed
Fixed jest by adding >= 0 in lifecycle.js line 133
1 parent 809b32f commit 231071a

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

  • x-pack/legacy/plugins/index_lifecycle_management/public/store/selectors

x-pack/legacy/plugins/index_lifecycle_management/public/store/selectors/lifecycle.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,12 @@ export const positiveNumbersAboveZeroErrorMessage = i18n.translate(
8484
}
8585
);
8686

87-
export const positiveNumbersEqualAboveZeroErrorMessage =
88-
i18n.translate('xpack.indexLifecycleMgmt.editPolicy.positiveNumberAboveZeroRequiredError', {
89-
defaultMessage: 'Only numbers equal to or above 0 are allowed.'
90-
});
87+
export const positiveNumbersEqualAboveZeroErrorMessage = i18n.translate(
88+
'xpack.indexLifecycleMgmt.editPolicy.positiveNumberAboveZeroRequiredError',
89+
{
90+
defaultMessage: 'Only numbers equal to or above 0 are allowed.',
91+
}
92+
);
9193

9294
export const validatePhase = (type, phase, errors) => {
9395
const phaseErrors = {};
@@ -128,12 +130,11 @@ export const validatePhase = (type, phase, errors) => {
128130
} else if (
129131
(numberedAttribute === PHASE_ROLLOVER_MINIMUM_AGE ||
130132
numberedAttribute === PHASE_PRIMARY_SHARD_COUNT) &&
131-
phase[numberedAttribute] < 0
133+
phase[numberedAttribute] <= 0
132134
) {
133135
phaseErrors[numberedAttribute] = [positiveNumbersEqualAboveZeroErrorMessage];
134136
}
135137
}
136-
137138
}
138139
if (phase[PHASE_ROLLOVER_ENABLED]) {
139140
if (
@@ -167,7 +168,6 @@ export const validatePhase = (type, phase, errors) => {
167168
}
168169

169170
if (phase[PHASE_FORCE_MERGE_ENABLED]) {
170-
171171
if (!isNumber(phase[PHASE_FORCE_MERGE_SEGMENTS])) {
172172
phaseErrors[PHASE_FORCE_MERGE_SEGMENTS] = [numberRequiredMessage];
173173
} else if (phase[PHASE_FORCE_MERGE_SEGMENTS] < 1) {

0 commit comments

Comments
 (0)