From 82a6197bea16d7f511f923c95c770d6656ba9dd2 Mon Sep 17 00:00:00 2001 From: Elena Stoeva Date: Tue, 22 Oct 2024 12:53:20 +0100 Subject: [PATCH] Fix type errors --- .../edit_data_retention_modal/validations.test.ts | 6 +++--- .../edit_data_retention_modal/validations.ts | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/x-pack/plugins/index_management/public/application/sections/home/data_stream_list/edit_data_retention_modal/validations.test.ts b/x-pack/plugins/index_management/public/application/sections/home/data_stream_list/edit_data_retention_modal/validations.test.ts index f8ea18a10479d..0768d0990cdc0 100644 --- a/x-pack/plugins/index_management/public/application/sections/home/data_stream_list/edit_data_retention_modal/validations.test.ts +++ b/x-pack/plugins/index_management/public/application/sections/home/data_stream_list/edit_data_retention_modal/validations.test.ts @@ -9,9 +9,9 @@ import { isBiggerThanGlobalMaxRetention } from './validations'; describe('isBiggerThanGlobalMaxRetention', () => { it('should return undefined if any argument is missing', () => { - expect(isBiggerThanGlobalMaxRetention(undefined, 'd', '30d')).toBeUndefined(); - expect(isBiggerThanGlobalMaxRetention(10, undefined, '30d')).toBeUndefined(); - expect(isBiggerThanGlobalMaxRetention(10, 'd', undefined)).toBeUndefined(); + expect(isBiggerThanGlobalMaxRetention('', 'd', '30d')).toBeUndefined(); + expect(isBiggerThanGlobalMaxRetention(10, '', '30d')).toBeUndefined(); + expect(isBiggerThanGlobalMaxRetention(10, 'd', '')).toBeUndefined(); }); it('should return an error message if retention is bigger than global max retention (in days)', () => { diff --git a/x-pack/plugins/index_management/public/application/sections/home/data_stream_list/edit_data_retention_modal/validations.ts b/x-pack/plugins/index_management/public/application/sections/home/data_stream_list/edit_data_retention_modal/validations.ts index afaf236edf49b..831ac2f4c26b9 100644 --- a/x-pack/plugins/index_management/public/application/sections/home/data_stream_list/edit_data_retention_modal/validations.ts +++ b/x-pack/plugins/index_management/public/application/sections/home/data_stream_list/edit_data_retention_modal/validations.ts @@ -38,9 +38,9 @@ const isRetentionBiggerThan = (valueA: string, valueB: string) => { }; export const isBiggerThanGlobalMaxRetention = ( - retentionValue, - retentionTimeUnit, - globalMaxRetention + retentionValue: string | number, + retentionTimeUnit: string, + globalMaxRetention: string ) => { if (!retentionValue || !retentionTimeUnit || !globalMaxRetention) { return undefined;