Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
9097b67
Add pagination for node columns
ugouhar Nov 18, 2025
1f640ae
Pagination using display prop
ugouhar Nov 19, 2025
a22f8d1
Column level lineage working with pagination to some extent
ugouhar Nov 19, 2025
8ff8a25
Trace columns on mouse over and out and handle click
ugouhar Nov 20, 2025
5b23b6a
Different color for selected columns state
ugouhar Nov 20, 2025
94fdf37
Showing columns of other pages at bottom
ugouhar Nov 20, 2025
7e89d7b
Mouseenter and opacity
ugouhar Nov 21, 2025
9ee3278
Fix edges pointing randomly
ugouhar Nov 24, 2025
79a8bcc
Rename to mouse enter and leave
ugouhar Nov 24, 2025
97123e7
Fix some styling
ugouhar Nov 24, 2025
1fe8cea
Use colors from palette
ugouhar Nov 24, 2025
3372185
Fix edge color, opacity and display
ugouhar Nov 24, 2025
66ecdf3
Highlight selected edge and connected columns on edge click
ugouhar Nov 25, 2025
b5ea589
Show connected edges instantly
ugouhar Nov 25, 2025
361c751
Highlighting column while creating edge
ugouhar Nov 25, 2025
c92cdd8
Show all edges initially and hide on select or hover
ugouhar Nov 26, 2025
1af9330
Hide col edges when node is selected and hide node edges when col is …
ugouhar Nov 26, 2025
34286de
Only show edges when both source and target is present
ugouhar Nov 26, 2025
6758720
Hide other nodes during node tracing
ugouhar Nov 26, 2025
bee3b6d
Hightlight edge on hover
ugouhar Nov 27, 2025
40bc696
Toggle search bar also using cols-dropdown button
ugouhar Nov 27, 2025
cd8f772
show the traced columns even when node is collapsed
ugouhar Nov 27, 2025
81d0ea3
Hide footer as when columns are collapsed and column layer is applied
ugouhar Nov 27, 2025
46b102c
Remove items of previous page and items of current page
ugouhar Nov 27, 2025
9a289c1
Get items of previous and current page properly
ugouhar Nov 28, 2025
e032228
Fix for edges pointing randomly
ugouhar Nov 28, 2025
652f966
Further fix for edges pointing randomly
ugouhar Nov 28, 2025
4193a57
Handle nested columns for showing edges
ugouhar Nov 28, 2025
4925ac2
Keep other nodes as it is when a node is selected
ugouhar Nov 28, 2025
b726beb
Add test for pagination functionality
ugouhar Nov 30, 2025
2cedc87
Add test for should select a column when it is clicked
ugouhar Nov 30, 2025
98a37aa
Add test for should render the selected column at the bottom of page …
ugouhar Nov 30, 2025
ba69651
Add test for should keep the traced column visible when columns dropd…
ugouhar Nov 30, 2025
449c10b
Add unit tests for pagination in columns
ugouhar Dec 1, 2025
f3c3f3c
Remove unused mocks
ugouhar Dec 1, 2025
d85c68d
Fix column colors
ugouhar Dec 1, 2025
98fef51
Hide icon on edge if edge is hidden
ugouhar Dec 1, 2025
fd031aa
Instantly show creating node-node edge
ugouhar Dec 1, 2025
a0d7e63
Refactor 1
ugouhar Dec 1, 2025
5c6ed11
Refactor 2
ugouhar Dec 1, 2025
48e817e
Replace getColumnContent ColumnContent component
ugouhar Dec 2, 2025
b2dc613
Remove show cols while node is collapased and move page state to Node…
ugouhar Dec 2, 2025
6c85c80
Remove redundant check
ugouhar Dec 2, 2025
dd8659a
Use colors present in palettle only
ugouhar Dec 2, 2025
ad9bc44
Fix unit test
ugouhar Dec 3, 2025
79fe0d6
Refactor test1
ugouhar Dec 3, 2025
7d9d665
Refactor test2
ugouhar Dec 3, 2025
4083abf
Fix customnode test
ugouhar Dec 3, 2025
409a384
Fix test in CustomEdge
ugouhar Dec 3, 2025
cbe9744
Add tests for CustomEdge
ugouhar Dec 3, 2025
36665c6
Refactor for customedge tests
ugouhar Dec 3, 2025
fa9b7ff
Fix test for CustomNodeUtils
ugouhar Dec 3, 2025
91469df
Fix unit tests
ugouhar Dec 3, 2025
6e8fe24
Fix sonarcube warnings
ugouhar Dec 3, 2025
a442da9
Simplify updatedStyle
ugouhar Dec 3, 2025
3c11410
Fix integ test1
ugouhar Dec 4, 2025
d2f2e69
fix integ test
ugouhar Dec 5, 2025
17e919a
Fix integ test
ugouhar Dec 5, 2025
af0a3d2
Fix integ test4
ugouhar Dec 6, 2025
3158135
Fix integ test5
ugouhar Dec 6, 2025
b22beac
Test pagination in column level lineage
ugouhar Dec 7, 2025
7f594a6
Fix unit test
ugouhar Dec 7, 2025
2cd0c36
Address PR comments
ugouhar Dec 8, 2025
d3100e5
Colors in arrow head
ugouhar Dec 8, 2025
374519c
Revert "Colors in arrow head"
ugouhar Dec 8, 2025
c21fa0b
Update arrow position to not overlap with left border of column
ugouhar Dec 8, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ export const dragAndDropNode = async (
await page.mouse.down();
const box = (await destinationElement.boundingBox()) as DOMRect;
const x = box.x + 250;
const y = box.y + box.height / 2;
const y = box.y + box.height / 2 + 100;
await page.mouse.move(x, y, { steps: 20 });
await page.mouse.up();
};
Expand Down Expand Up @@ -475,6 +475,8 @@ export const addColumnLineage = async (
);
await lineageRes;

await page.getByTestId(`column-${toColumnNode}`).click();

if (exitEditMode) {
await editLineageClick(page);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,13 @@
* limitations under the License.
*/

import { createTheme, Theme, ThemeProvider } from '@mui/material/styles';
import { ThemeColors } from '@openmetadata/ui-core-components';
import { render, screen } from '@testing-library/react';
import React from 'react';
import { MemoryRouter } from 'react-router-dom';
import { EdgeProps, Position } from 'reactflow';
import { useLineageProvider } from '../../../context/LineageProvider/LineageProvider';
import { EntityType } from '../../../enums/entity.enum';
import { LineageLayer } from '../../../generated/settings/settings';
import { CustomEdge } from './CustomEdge.component';
Expand Down Expand Up @@ -61,6 +65,7 @@ const mockCustomEdgeProp = {
},
},
isEditMode: true,
dataTestId: 'edge-id1',
},
selected: true,
} as EdgeProps;
Expand All @@ -72,13 +77,50 @@ jest.mock('../../../context/LineageProvider/LineageProvider', () => ({
pipelineStatus: {},
activeLayer: [LineageLayer.ColumnLevelLineage],
fetchPipelineStatus: jest.fn(),
columnsInCurrentPages: [],
})),
}));

const mockThemeColors: ThemeColors = {
indigo: {
600: '#4F46E5',
},
error: {
600: '#D92D20',
},
} as ThemeColors;

const theme: Theme = createTheme({
palette: {
primary: {
main: '#0958D9',
},
allShades: mockThemeColors,
},
});

const Wrapper = ({ children }: { children: React.ReactNode }) => (
<ThemeProvider theme={theme}>
<MemoryRouter>{children}</MemoryRouter>
</ThemeProvider>
);

const mockLineageProvider = (overrides = {}) => {
(useLineageProvider as jest.Mock).mockImplementation(() => ({
tracedNodes: [],
tracedColumns: [],
pipelineStatus: {},
activeLayer: [LineageLayer.ColumnLevelLineage],
fetchPipelineStatus: jest.fn(),
columnsInCurrentPages: [],
...overrides,
}));
};

describe('Test CustomEdge Component', () => {
it('Check if CustomEdge has selected as false', async () => {
render(<CustomEdge {...mockCustomEdgeProp} selected={false} />, {
wrapper: MemoryRouter,
wrapper: Wrapper,
});

const deleteButton = screen.queryByTestId('delete-button');
Expand All @@ -101,7 +143,7 @@ describe('Test CustomEdge Component', () => {
}}
/>,
{
wrapper: MemoryRouter,
wrapper: Wrapper,
}
);

Expand All @@ -111,4 +153,143 @@ describe('Test CustomEdge Component', () => {

expect(pipelineLabelAsEdge).toBeInTheDocument();
});

it('should display edge when no nodes or columns are traced', () => {
render(<CustomEdge {...mockCustomEdgeProp} />, {
wrapper: Wrapper,
});

const edgePath = screen.getByTestId('edge-id1');

expect(edgePath).toBeInTheDocument();
expect(edgePath).toHaveStyle({ display: 'block' });
});

it('should hide edge when nodes are traced but current edge nodes are not in traced list', () => {
mockLineageProvider({ tracedNodes: ['other-node-1', 'other-node-2'] });

render(<CustomEdge {...mockCustomEdgeProp} />, {
wrapper: Wrapper,
});

const edgePath = screen.getByTestId('edge-id1');

expect(edgePath).toBeInTheDocument();
expect(edgePath).toHaveStyle({ display: 'none' });
});

it('should display edge when both edge nodes are in traced nodes list', () => {
mockLineageProvider({ tracedNodes: ['1', '2'] });

render(<CustomEdge {...mockCustomEdgeProp} />, {
wrapper: Wrapper,
});

const edgePath = screen.getByTestId('edge-id1');

expect(edgePath).toBeInTheDocument();
expect(edgePath).toHaveStyle({ display: 'block' });
});

it('should display column lineage edge when columns are highlighted', () => {
const encodedSourceHandle = btoa(encodeURIComponent('column1'));
const encodedTargetHandle = btoa(encodeURIComponent('column2'));

mockLineageProvider({ tracedColumns: ['column1', 'column2'] });

render(
<CustomEdge
{...mockCustomEdgeProp}
data={{
...mockCustomEdgeProp.data,
isColumnLineage: true,
sourceHandle: encodedSourceHandle,
targetHandle: encodedTargetHandle,
}}
/>,
{
wrapper: Wrapper,
}
);

const edgePath = screen.getByTestId('edge-id1');

expect(edgePath).toBeInTheDocument();
expect(edgePath).toHaveStyle({ display: 'block' });
});

it('should hide column lineage edge when columns are traced but not highlighted', () => {
mockLineageProvider({ tracedColumns: ['other-column'] });

render(
<CustomEdge
{...mockCustomEdgeProp}
data={{
...mockCustomEdgeProp.data,
isColumnLineage: true,
sourceHandle: 'column1',
targetHandle: 'column2',
}}
/>,
{
wrapper: Wrapper,
}
);

const edgePath = screen.getByTestId('edge-id1');

expect(edgePath).toBeInTheDocument();
expect(edgePath).toHaveStyle({ display: 'none' });
});

it('should hide column lineage edge when columns are not in current page', () => {
mockLineageProvider({ columnsInCurrentPages: ['other-column'] });

render(
<CustomEdge
{...mockCustomEdgeProp}
data={{
...mockCustomEdgeProp.data,
isColumnLineage: true,
sourceHandle: 'column1',
targetHandle: 'column2',
}}
/>,
{
wrapper: Wrapper,
}
);

const edgePath = screen.getByTestId('edge-id1');

expect(edgePath).toBeInTheDocument();
expect(edgePath).toHaveStyle({ display: 'none' });
});

it('should display column lineage edge when both columns are in current page', () => {
const encodedSourceHandle = btoa(encodeURIComponent('column1'));
const encodedTargetHandle = btoa(encodeURIComponent('column2'));

mockLineageProvider({ columnsInCurrentPages: ['column1', 'column2'] });

render(
<CustomEdge
{...mockCustomEdgeProp}
data={{
...mockCustomEdgeProp.data,
isColumnLineage: true,
sourceHandle: encodedSourceHandle,
targetHandle: encodedTargetHandle,
}}
/>,
{
wrapper: Wrapper,
}
);

const edgePath = screen.getByTestId('edge-id1');

expect(edgePath).toBeInTheDocument();
expect(edgePath).toHaveStyle({ display: 'block' });
});
});
Loading