19 lines
559 B
TypeScript

import test from 'ava';
import { Edge, Color, EdgeStyles } from '../lib';
test ('serialize', (t) => {
const e = new Edge ('foo', 'bar', false);
e.color = Color.white;
e.style = EdgeStyles.dashed;
const serialized = e.toString ();
t.is (serialized, 'foo -- bar [style="dashed",color="#ffffff"]');
});
test ('serialize directional', (t) => {
const e = new Edge ('foo', 'bar', true);
e.color = Color.white;
e.style = EdgeStyles.dashed;
const serialized = e.toString ();
t.is (serialized, 'foo -> bar [style="dashed",color="#ffffff"]');
});