From 2b9941c55a47ae6eb9ebc4e8e763ce7f66a85785 Mon Sep 17 00:00:00 2001 From: Pranita Date: Tue, 9 Sep 2025 21:35:05 +0530 Subject: [PATCH] fix unit test --- .../resources/ui/src/utils/TagsUtils.test.tsx | 24 ++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/TagsUtils.test.tsx b/openmetadata-ui/src/main/resources/ui/src/utils/TagsUtils.test.tsx index f9cb82e3f13..d6f817f4dca 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/TagsUtils.test.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/utils/TagsUtils.test.tsx @@ -92,20 +92,38 @@ describe('getTagAssetsQueryFilter', () => { const tagFQN = 'Tier.Tier1'; const result = getTagAssetsQueryFilter(tagFQN); - expect(result).toBe(`(tier.tagFQN:"${tagFQN}")`); + expect(result).toEqual({ + query: { + term: { + 'tier.tagFQN': tagFQN, + }, + }, + }); }); it('returns query filter for tagFQN starting with "Certification"', () => { const tagFQN = 'Certification.Gold'; const result = getTagAssetsQueryFilter(tagFQN); - expect(result).toBe(`(certification.tagLabel.tagFQN:"${tagFQN}")`); + expect(result).toEqual({ + query: { + term: { + 'certification.tagLabel.tagFQN': tagFQN, + }, + }, + }); }); it('returns common query filter for tagFQN starting with any name expect "Tier and Certification"', () => { const tagFQN = 'ClassificationTag.Gold'; const result = getTagAssetsQueryFilter(tagFQN); - expect(result).toBe(`(tags.tagFQN:"${tagFQN}")`); + expect(result).toEqual({ + query: { + term: { + 'tags.tagFQN': tagFQN, + }, + }, + }); }); });