From 67fdf8d45fd0bef5422d24b996d129a5f90bb7f6 Mon Sep 17 00:00:00 2001 From: Thomas Neirynck Date: Tue, 21 Jan 2025 16:59:19 -0500 Subject: [PATCH] add unit tests --- .../packages/shared/kbn-es-query/src/utils.test.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/platform/packages/shared/kbn-es-query/src/utils.test.ts b/src/platform/packages/shared/kbn-es-query/src/utils.test.ts index b7ac39e4c7eec..4e218bc32f290 100644 --- a/src/platform/packages/shared/kbn-es-query/src/utils.test.ts +++ b/src/platform/packages/shared/kbn-es-query/src/utils.test.ts @@ -30,5 +30,17 @@ describe('util tests', () => { it('should validate CCS pattern', () => { expect(isCCSRemoteIndexName('*:logstash-{now/d-2d}')).toBe(true); }); + + it('should not validate selctor with wildcard', () => { + expect(isCCSRemoteIndexName('my-data-stream::*')).toBe(false); + }); + + it('should not validate index name with selector', () => { + expect(isCCSRemoteIndexName('my-data-stream::failures')).toBe(false); + }); + + it('should not validate wildcard with selector', () => { + expect(isCCSRemoteIndexName('-logs-*::data')).toBe(false); + }); }); });