diff --git a/openmetadata-ui/src/main/resources/ui/playwright/support/entity/EntityClass.ts b/openmetadata-ui/src/main/resources/ui/playwright/support/entity/EntityClass.ts index 10e25af2262..6d8044d3785 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/support/entity/EntityClass.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/support/entity/EntityClass.ts @@ -201,7 +201,8 @@ export class EntityClass { async tag(page: Page, tag1: string, tag2: string) { await assignTag(page, tag1); await assignTag(page, tag2, 'Edit'); - await removeTag(page, [tag1, tag2]); + await removeTag(page, [tag2]); + await removeTag(page, [tag1]); await page .getByTestId('entity-right-panel') @@ -233,7 +234,13 @@ export class EntityClass { }); await removeTagsFromChildren({ page, - tags: [tag1, tag2], + tags: [tag2], + rowId, + rowSelector, + }); + await removeTagsFromChildren({ + page, + tags: [tag1], rowId, rowSelector, }); diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/CommonUtils.test.ts b/openmetadata-ui/src/main/resources/ui/src/utils/CommonUtils.test.ts index e2b58ee716a..d15eabe5d68 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/CommonUtils.test.ts +++ b/openmetadata-ui/src/main/resources/ui/src/utils/CommonUtils.test.ts @@ -50,7 +50,6 @@ import { mockTableNameWithSpecialChar4, mockTableNameWithSpecialChar5, mockTags, - sortedMockTags, } from './CommonUtils.mock'; const AXIOS_ERROR_MESSAGE = { @@ -71,21 +70,7 @@ const AXIOS_ERROR_MESSAGE = { describe('Tests for CommonUtils', () => { describe('Tests for sortTagsCaseInsensitive function', () => { it('Input of unsorted array to sortTagsCaseInsensitive should return array of tags sorted by tagFQN', () => { - expect(sortTagsCaseInsensitive(cloneDeep(mockTags))).toEqual( - sortedMockTags - ); - }); - - it('Input of sorted array to sortTagsCaseInsensitive should return array of tags sorted by tagFQN', () => { - expect(sortTagsCaseInsensitive(cloneDeep(sortedMockTags))).toEqual( - sortedMockTags - ); - }); - - it('Array returned by sortTagsCaseInsensitive should not be equal to the unsorted input array of tags', () => { - expect(sortTagsCaseInsensitive(cloneDeep(mockTags))).not.toEqual( - mockTags - ); + expect(sortTagsCaseInsensitive(cloneDeep(mockTags))).toEqual(mockTags); }); it('Function getNameFromFQN should return the correct table name for fqn without special characters', () => { diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/CommonUtils.tsx b/openmetadata-ui/src/main/resources/ui/src/utils/CommonUtils.tsx index fe845fb755c..c14863fab9c 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/CommonUtils.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/utils/CommonUtils.tsx @@ -733,9 +733,7 @@ export const getTrimmedContent = (content: string, limit: number) => { }; export const sortTagsCaseInsensitive = (tags: TagLabel[]) => { - return tags.sort((tag1, tag2) => - tag1.tagFQN.toLowerCase() < tag2.tagFQN.toLowerCase() ? -1 : 1 - ); + return tags; }; export const Transi18next = ({ diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/DashboardDetailsUtils.test.ts b/openmetadata-ui/src/main/resources/ui/src/utils/DashboardDetailsUtils.test.ts index 6e12bb0f96c..d37bba551bb 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/DashboardDetailsUtils.test.ts +++ b/openmetadata-ui/src/main/resources/ui/src/utils/DashboardDetailsUtils.test.ts @@ -13,24 +13,12 @@ import { cloneDeep } from 'lodash'; import { sortTagsForCharts } from './DashboardDetailsUtils'; -import { mockCharts, sortedTagsMockCharts } from './DashboardDetailsUtils.mock'; +import { mockCharts } from './DashboardDetailsUtils.mock'; describe('Tests for DashboardDetailsUtils', () => { describe('Tests for sortTagsForCharts function', () => { it('Input of unsorted array to sortTagsForCharts should return charts array with sorted order of tags by tagsFQN', () => { - expect(sortTagsForCharts(cloneDeep(mockCharts))).toEqual( - sortedTagsMockCharts - ); - }); - - it('Input of sorted array to sortTagsForCharts should return charts array with sorted order of tags by tagsFQN', () => { - expect(sortTagsForCharts(cloneDeep(sortedTagsMockCharts))).toEqual( - sortedTagsMockCharts - ); - }); - - it('The Array returned by sortTagsForCharts should not be eqaul to the unsorted input array', () => { - expect(sortTagsForCharts(cloneDeep(mockCharts))).not.toEqual(mockCharts); + expect(sortTagsForCharts(cloneDeep(mockCharts))).toEqual(mockCharts); }); }); }); diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/PipelineDetailsUtils.test.ts b/openmetadata-ui/src/main/resources/ui/src/utils/PipelineDetailsUtils.test.ts index 41d2ad4871f..1175dbfe384 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/PipelineDetailsUtils.test.ts +++ b/openmetadata-ui/src/main/resources/ui/src/utils/PipelineDetailsUtils.test.ts @@ -14,7 +14,6 @@ import { mockPipelineDetails, mockPipelineDetailsWithoutTaskTags, - mockSortedPipelineDetails, } from './mocks/PipelineDetailsUtils.mock'; import { getFormattedPipelineDetails } from './PipelineDetailsUtils'; @@ -22,7 +21,7 @@ describe('PipelineDetailsUtils test', () => { it('getFormattedPipelineDetails should return pipeline details with sorted tags for tasks', () => { const results = getFormattedPipelineDetails(mockPipelineDetails); - expect(results).toEqual(mockSortedPipelineDetails); + expect(results).toEqual(mockPipelineDetails); }); it('getFormattedPipelineDetails should return pipeline details without any changes in case no tasks are present in it', () => {