chore: Reset mock in edgeMarker test

This commit is contained in:
Sidharth Vinod
2023-11-09 11:36:45 +05:30
parent e46626d3ed
commit 09d9c31d53

View File

@@ -1,14 +1,19 @@
import type { Mocked } from 'vitest';
import type { SVG } from '../diagram-api/types.js'; import type { SVG } from '../diagram-api/types.js';
import { addEdgeMarkers } from './edgeMarker.js'; import { addEdgeMarkers } from './edgeMarker.js';
describe('addEdgeMarker', () => { describe('addEdgeMarker', () => {
const svgPath = { const svgPath = {
attr: vitest.fn(), attr: vitest.fn(),
} as unknown as SVG; } as unknown as Mocked<SVG>;
const url = 'http://example.com'; const url = 'http://example.com';
const id = 'test'; const id = 'test';
const diagramType = 'test'; const diagramType = 'test';
beforeEach(() => {
svgPath.attr.mockReset();
});
it('should add markers for arrow_cross:arrow_point', () => { it('should add markers for arrow_cross:arrow_point', () => {
const arrowTypeStart = 'arrow_cross'; const arrowTypeStart = 'arrow_cross';
const arrowTypeEnd = 'arrow_point'; const arrowTypeEnd = 'arrow_point';