fix: failing unit tests

on-behalf-of: @Mermaid-Chart <hello@mermaidchart.com>
This commit is contained in:
darshanr0107
2025-08-08 14:32:25 +05:30
parent 28717e108d
commit 68c01b76bf
2 changed files with 2 additions and 2 deletions

View File

@@ -182,7 +182,7 @@ describe('Cose-Bilkent Layout Algorithm', () => {
it('should throw error for invalid nodes array', () => {
const invalidData = { ...mockLayoutData, nodes: null as any };
expect(() => validateLayoutData(invalidData)).toThrow('Nodes array is required');
expect(() => validateLayoutData(invalidData)).toThrow('No nodes found in layout data');
});
it('should throw error for invalid edges array', () => {

View File

@@ -65,7 +65,7 @@ export function validateLayoutData(data: LayoutData): boolean {
throw new Error('Root node is required');
}
if (!data.nodes || !Array.isArray(data.nodes) || data.nodes.length === 0) {
if (!data.nodes || !Array.isArray(data.nodes)) {
throw new Error('No nodes found in layout data');
}