Skip to content

Commit

Permalink
test: add test to make sure connection line becomes visible
Browse files Browse the repository at this point in the history
  • Loading branch information
alexgrozav committed Dec 17, 2024
1 parent b559193 commit b55084d
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { setActivePinia } from 'pinia';
import type { ConnectionLineProps } from '@vue-flow/core';
import { Position } from '@vue-flow/core';
import { createCanvasProvide } from '@/__tests__/data';
import { waitFor } from '@testing-library/vue';

const DEFAULT_PROPS = {
sourceX: 0,
Expand Down Expand Up @@ -63,4 +64,19 @@ describe('CanvasConnectionLine', () => {
'M-50 130L-90 130L -124,130Q -140,130 -140,114L -140,-84Q -140,-100 -124,-100L-100 -100',
);
});

it('should show the connection line after a short delay', async () => {
vi.useFakeTimers();
const { container } = renderComponent({
props: DEFAULT_PROPS,
});

const edge = container.querySelector('.vue-flow__edge-path');

expect(edge).not.toHaveClass('visible');

vi.advanceTimersByTime(300);

await waitFor(() => expect(edge).toHaveClass('visible'));
});
});

0 comments on commit b55084d

Please # to comment.